From 05651944739f1b6d50fddda53d48069bc786740e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 18 Nov 2022 15:26:22 +0100 Subject: [PATCH] refactor(core): Introduce overload for number-type node parameter (no-changelog) (#4644) * :blue_book: Set up overloads * :blue_book: Add temporary assertion * :fire: Remove inferrable number assertions * :pencil2: Add ticket ref --- .../ActiveCampaign/ActiveCampaign.node.ts | 18 +- .../nodes/Affinity/Affinity.node.ts | 8 +- .../nodes/AgileCrm/AgileCrm.node.ts | 4 +- .../nodes/Airtable/Airtable.node.ts | 2 +- packages/nodes-base/nodes/Asana/Asana.node.ts | 13 +- .../nodes/Automizy/Automizy.node.ts | 4 +- .../nodes/Autopilot/Autopilot.node.ts | 6 +- .../AwsCertificateManager.node.ts | 13 +- .../nodes/Aws/DynamoDB/AwsDynamoDB.node.ts | 2 +- .../nodes-base/nodes/Aws/ELB/AwsElb.node.ts | 4 +- .../nodes-base/nodes/Aws/S3/AwsS3.node.ts | 8 +- .../nodes-base/nodes/Aws/SES/AwsSes.node.ts | 4 +- .../Aws/Transcribe/AwsTranscribe.node.ts | 2 +- .../v1/actions/employee/getAll/execute.ts | 2 +- .../employeeDocument/getAll/execute.ts | 2 +- .../v1/actions/file/getAll/execute.ts | 2 +- .../nodes/Baserow/GenericFunctions.ts | 2 +- .../nodes/Beeminder/Beeminder.node.ts | 2 +- .../nodes/Bitwarden/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Box/Box.node.ts | 4 +- .../nodes-base/nodes/Bubble/Bubble.node.ts | 2 +- .../nodes/CircleCi/CircleCi.node.ts | 2 +- .../nodes/Cisco/Webex/CiscoWebex.node.ts | 6 +- .../nodes-base/nodes/ClickUp/ClickUp.node.ts | 20 +- .../nodes/Clockify/Clockify.node.ts | 12 +- .../nodes/Cloudflare/Cloudflare.node.ts | 2 +- .../nodes-base/nodes/Cockpit/Cockpit.node.ts | 2 +- packages/nodes-base/nodes/Coda/Coda.node.ts | 14 +- .../nodes/CoinGecko/CoinGecko.node.ts | 8 +- .../nodes/Contentful/Contentful.node.ts | 6 +- .../nodes/ConvertKit/ConvertKit.node.ts | 14 +- .../nodes/Copper/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Demio/Demio.node.ts | 2 +- .../nodes/Discourse/Discourse.node.ts | 8 +- .../nodes-base/nodes/Disqus/Disqus.node.ts | 6 +- .../nodes-base/nodes/Dropbox/Dropbox.node.ts | 12 +- .../nodes-base/nodes/ERPNext/ERPNext.node.ts | 2 +- packages/nodes-base/nodes/Egoi/Egoi.node.ts | 2 +- .../ElasticSecurity/GenericFunctions.ts | 2 +- .../Elasticsearch/Elasticsearch.node.ts | 2 +- .../nodes-base/nodes/Emelia/Emelia.node.ts | 4 +- packages/nodes-base/nodes/Flow/Flow.node.ts | 2 +- .../nodes/Freshdesk/Freshdesk.node.ts | 2 +- .../nodes/Freshservice/GenericFunctions.ts | 2 +- .../nodes/GetResponse/GetResponse.node.ts | 2 +- packages/nodes-base/nodes/Git/Git.node.ts | 2 +- .../nodes-base/nodes/Github/Github.node.ts | 10 +- .../nodes-base/nodes/Gitlab/Gitlab.node.ts | 2 +- .../nodes/GoToWebinar/GenericFunctions.ts | 2 +- .../nodes/GoToWebinar/GoToWebinar.node.ts | 4 +- .../Google/Analytics/GoogleAnalytics.node.ts | 2 +- .../Google/BigQuery/GoogleBigQuery.node.ts | 2 +- .../nodes/Google/Books/GoogleBooks.node.ts | 6 +- .../Google/Calendar/GoogleCalendar.node.ts | 2 +- .../nodes/Google/Chat/GoogleChat.node.ts | 4 +- .../Google/Contacts/GoogleContacts.node.ts | 2 +- .../nodes/Google/Drive/GoogleDrive.node.ts | 4 +- .../GoogleFirebaseCloudFirestore.node.ts | 4 +- .../Google/GSuiteAdmin/GSuiteAdmin.node.ts | 4 +- .../nodes/Google/Gmail/v1/GmailV1.node.ts | 159 ++++++------ .../nodes/Google/Gmail/v2/GmailV2.node.ts | 8 +- .../nodes/Google/Slides/GoogleSlides.node.ts | 2 +- .../nodes/Google/Task/GoogleTasks.node.ts | 2 +- .../nodes/Google/YouTube/YouTube.node.ts | 10 +- .../nodes-base/nodes/Gotify/Gotify.node.ts | 5 +- .../nodes-base/nodes/Grafana/Grafana.node.ts | 8 +- packages/nodes-base/nodes/Grist/Grist.node.ts | 2 +- .../nodes/HackerNews/HackerNews.node.ts | 2 +- .../nodes-base/nodes/HaloPSA/HaloPSA.node.ts | 8 +- .../nodes/Harvest/GenericFunctions.ts | 2 +- .../nodes/HelpScout/HelpScout.node.ts | 8 +- .../nodes/HomeAssistant/HomeAssistant.node.ts | 8 +- .../nodes-base/nodes/Hubspot/Hubspot.node.ts | 22 +- .../nodes-base/nodes/Hunter/Hunter.node.ts | 2 +- .../nodes/Intercom/Intercom.node.ts | 10 +- .../nodes/InvoiceNinja/InvoiceNinja.node.ts | 12 +- .../nodes-base/nodes/Jenkins/Jenkins.node.ts | 2 +- packages/nodes-base/nodes/Jira/Jira.node.ts | 8 +- packages/nodes-base/nodes/Keap/Keap.node.ts | 16 +- .../nodes/Kitemaker/GenericFunctions.ts | 4 +- .../nodes/KoBoToolbox/KoBoToolbox.node.ts | 6 +- .../nodes-base/nodes/Lemlist/Lemlist.node.ts | 4 +- .../nodes-base/nodes/Linear/Linear.node.ts | 2 +- .../nodes-base/nodes/Magento/Magento2.node.ts | 6 +- .../nodes/Mailchimp/Mailchimp.node.ts | 6 +- .../nodes/MailerLite/MailerLite.node.ts | 2 +- .../nodes/Marketstack/GenericFunctions.ts | 2 +- .../nodes/Matrix/GenericFunctions.ts | 2 +- .../v1/actions/channel/members/execute.ts | 4 +- .../v1/actions/reaction/getAll/execute.ts | 2 +- .../v1/actions/user/getAll/execute.ts | 2 +- .../nodes-base/nodes/Mautic/Mautic.node.ts | 4 +- .../nodes-base/nodes/Medium/Medium.node.ts | 2 +- .../Dynamics/MicrosoftDynamicsCrm.node.ts | 2 +- .../Microsoft/Excel/MicrosoftExcel.node.ts | 8 +- .../Outlook/MicrosoftOutlook.node.ts | 10 +- .../Microsoft/Teams/MicrosoftTeams.node.ts | 10 +- .../Microsoft/ToDo/MicrosoftToDo.node.ts | 6 +- .../nodes-base/nodes/Misp/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Misp/Misp.node.ts | 4 +- .../nodes/MondayCom/MondayCom.node.ts | 6 +- .../N8nTrainingCustomerDatastore.node.ts | 2 +- packages/nodes-base/nodes/Nasa/Nasa.node.ts | 2 +- .../nodes-base/nodes/Netlify/Netlify.node.ts | 4 +- .../nodes/NextCloud/NextCloud.node.ts | 2 +- .../nodes-base/nodes/NocoDB/NocoDB.node.ts | 229 ++++++++++-------- .../nodes/Notion/v1/NotionV1.node.ts | 50 ++-- .../nodes/Notion/v2/NotionV2.node.ts | 64 +++-- packages/nodes-base/nodes/Odoo/Odoo.node.ts | 8 +- packages/nodes-base/nodes/Onfleet/Onfleet.ts | 4 +- packages/nodes-base/nodes/Orbit/Orbit.node.ts | 8 +- packages/nodes-base/nodes/Oura/Oura.node.ts | 6 +- .../nodes-base/nodes/Paddle/Paddle.node.ts | 10 +- .../nodes/PagerDuty/PagerDuty.node.ts | 6 +- .../nodes-base/nodes/PayPal/PayPal.node.ts | 2 +- .../nodes/Phantombuster/Phantombuster.node.ts | 2 +- .../nodes/PhilipsHue/PhilipsHue.node.ts | 2 +- .../nodes/Pipedrive/Pipedrive.node.ts | 24 +- .../nodes/Pushbullet/Pushbullet.node.ts | 2 +- .../nodes/QuickBase/QuickBase.node.ts | 6 +- .../nodes/QuickBooks/GenericFunctions.ts | 2 +- .../nodes/Raindrop/Raindrop.node.ts | 6 +- .../nodes-base/nodes/Reddit/Reddit.node.ts | 6 +- packages/nodes-base/nodes/S3/S3.node.ts | 28 ++- .../nodes/Salesforce/Salesforce.node.ts | 20 +- .../nodes/Salesmate/Salesmate.node.ts | 6 +- .../nodes/SeaTable/SeaTable.node.ts | 2 +- .../SecurityScorecard.node.ts | 18 +- .../nodes/SendGrid/SendGrid.node.ts | 22 +- .../nodes/SentryIo/SentryIo.node.ts | 24 +- .../nodes/ServiceNow/ServiceNow.node.ts | 20 +- .../nodes-base/nodes/Shopify/Shopify.node.ts | 4 +- packages/nodes-base/nodes/Slack/Slack.node.ts | 16 +- .../nodes/Splunk/GenericFunctions.ts | 4 +- .../nodes-base/nodes/Spotify/Spotify.node.ts | 22 +- .../nodes-base/nodes/Stackby/Stackby.node.ts | 2 +- .../nodes/Storyblok/Storyblok.node.ts | 4 +- .../nodes-base/nodes/Strapi/Strapi.node.ts | 4 +- .../nodes-base/nodes/Strava/Strava.node.ts | 4 +- .../nodes/Supabase/Supabase.node.ts | 2 +- .../v1/actions/contact/getAll/execute.ts | 2 +- .../v1/actions/customer/getAll/execute.ts | 2 +- .../v1/actions/rmm/getAll/execute.ts | 2 +- .../v1/actions/ticket/getAll/execute.ts | 2 +- .../nodes/Taiga/GenericFunctions.ts | 2 +- .../nodes/Tapfiliate/Tapfiliate.node.ts | 4 +- .../nodes-base/nodes/TheHive/TheHive.node.ts | 14 +- .../nodes/TravisCi/TravisCi.node.ts | 2 +- .../nodes-base/nodes/Trello/Trello.node.ts | 6 +- packages/nodes-base/nodes/Twist/Twist.node.ts | 6 +- .../nodes-base/nodes/Twitter/Twitter.node.ts | 2 +- .../UnleashedSoftware.node.ts | 4 +- .../nodes/UptimeRobot/UptimeRobot.node.ts | 8 +- .../nodes/UrlScanIo/GenericFunctions.ts | 2 +- .../VenafiTlsProtectDatacenter.node.ts | 2 +- .../VenafiTlsProtectCloud.node.ts | 12 +- .../nodes-base/nodes/Webflow/Webflow.node.ts | 2 +- packages/nodes-base/nodes/Wekan/Wekan.node.ts | 2 +- .../nodes/WooCommerce/WooCommerce.node.ts | 6 +- .../nodes/Wordpress/Wordpress.node.ts | 4 +- packages/nodes-base/nodes/Xero/Xero.node.ts | 4 +- .../nodes-base/nodes/Zammad/Zammad.node.ts | 8 +- .../nodes-base/nodes/Zendesk/Zendesk.node.ts | 10 +- .../nodes-base/nodes/Zoho/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 6 +- packages/workflow/src/Interfaces.ts | 23 +- 166 files changed, 783 insertions(+), 689 deletions(-) diff --git a/packages/nodes-base/nodes/ActiveCampaign/ActiveCampaign.node.ts b/packages/nodes-base/nodes/ActiveCampaign/ActiveCampaign.node.ts index f2a5c2170e..ac4b206409 100644 --- a/packages/nodes-base/nodes/ActiveCampaign/ActiveCampaign.node.ts +++ b/packages/nodes-base/nodes/ActiveCampaign/ActiveCampaign.node.ts @@ -388,7 +388,7 @@ export class ActiveCampaign implements INodeType { const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } Object.assign(qs, additionalFields); @@ -472,7 +472,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { @@ -641,7 +641,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { @@ -697,7 +697,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { @@ -804,7 +804,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { @@ -903,7 +903,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { @@ -1003,7 +1003,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { @@ -1092,7 +1092,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { @@ -1138,7 +1138,7 @@ export class ActiveCampaign implements INodeType { const simple = this.getNodeParameter('simple', i, true) as boolean; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (simple === true) { diff --git a/packages/nodes-base/nodes/Affinity/Affinity.node.ts b/packages/nodes-base/nodes/Affinity/Affinity.node.ts index b809436baa..fdaf76f1f8 100644 --- a/packages/nodes-base/nodes/Affinity/Affinity.node.ts +++ b/packages/nodes-base/nodes/Affinity/Affinity.node.ts @@ -165,7 +165,7 @@ export class Affinity implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); responseData = await affinityApiRequest.call(this, 'GET', `/lists`, {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -213,7 +213,7 @@ export class Affinity implements INodeType { qs, ); } else { - qs.page_size = this.getNodeParameter('limit', i) as number; + qs.page_size = this.getNodeParameter('limit', i); responseData = await affinityApiRequest.call( this, 'GET', @@ -308,7 +308,7 @@ export class Affinity implements INodeType { qs, ); } else { - qs.page_size = this.getNodeParameter('limit', i) as number; + qs.page_size = this.getNodeParameter('limit', i); responseData = await affinityApiRequest.call(this, 'GET', '/persons', {}, qs); responseData = responseData.persons; } @@ -396,7 +396,7 @@ export class Affinity implements INodeType { qs, ); } else { - qs.page_size = this.getNodeParameter('limit', i) as number; + qs.page_size = this.getNodeParameter('limit', i); responseData = await affinityApiRequest.call(this, 'GET', '/organizations', {}, qs); responseData = responseData.organizations; } diff --git a/packages/nodes-base/nodes/AgileCrm/AgileCrm.node.ts b/packages/nodes-base/nodes/AgileCrm/AgileCrm.node.ts index 235fc2ffa9..104967abfe 100644 --- a/packages/nodes-base/nodes/AgileCrm/AgileCrm.node.ts +++ b/packages/nodes-base/nodes/AgileCrm/AgileCrm.node.ts @@ -179,7 +179,7 @@ export class AgileCrm implements INodeType { true, ); } else { - body.page_size = this.getNodeParameter('limit', 0) as number; + body.page_size = this.getNodeParameter('limit', 0); responseData = await agileCrmApiRequest.call( this, 'POST', @@ -519,7 +519,7 @@ export class AgileCrm implements INodeType { page_size: limit, }); } else { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = await agileCrmApiRequest.call(this, 'GET', endpoint, undefined, { page_size: limit, }); diff --git a/packages/nodes-base/nodes/Airtable/Airtable.node.ts b/packages/nodes-base/nodes/Airtable/Airtable.node.ts index 9e85738e99..ef7c420b83 100644 --- a/packages/nodes-base/nodes/Airtable/Airtable.node.ts +++ b/packages/nodes-base/nodes/Airtable/Airtable.node.ts @@ -648,7 +648,7 @@ export class Airtable implements INodeType { if (returnAll === true) { responseData = await apiRequestAllItems.call(this, requestMethod, endpoint, body, qs); } else { - qs.maxRecords = this.getNodeParameter('limit', 0) as number; + qs.maxRecords = this.getNodeParameter('limit', 0); responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs); } diff --git a/packages/nodes-base/nodes/Asana/Asana.node.ts b/packages/nodes-base/nodes/Asana/Asana.node.ts index 51da262e01..63a0653e13 100644 --- a/packages/nodes-base/nodes/Asana/Asana.node.ts +++ b/packages/nodes-base/nodes/Asana/Asana.node.ts @@ -1978,7 +1978,7 @@ export class Asana implements INodeType { responseData = responseData.data; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as boolean; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -2067,7 +2067,7 @@ export class Asana implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as boolean; + qs.limit = this.getNodeParameter('limit', i); responseData = await asanaApiRequest.call(this, requestMethod, endpoint, body, qs); @@ -2365,7 +2365,7 @@ export class Asana implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as boolean; + qs.limit = this.getNodeParameter('limit', i); responseData = await asanaApiRequest.call(this, requestMethod, endpoint, body, qs); @@ -2410,10 +2410,9 @@ export class Asana implements INodeType { } returnData.push( - ...this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray(responseData), - { itemData: { item: i } }, - ), + ...this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { + itemData: { item: i }, + }), ); } catch (error) { if (this.continueOnFail()) { diff --git a/packages/nodes-base/nodes/Automizy/Automizy.node.ts b/packages/nodes-base/nodes/Automizy/Automizy.node.ts index a688393415..faf491779a 100644 --- a/packages/nodes-base/nodes/Automizy/Automizy.node.ts +++ b/packages/nodes-base/nodes/Automizy/Automizy.node.ts @@ -216,7 +216,7 @@ export class Automizy implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await automizyApiRequest.call( this, @@ -324,7 +324,7 @@ export class Automizy implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await automizyApiRequest.call(this, 'GET', `/smart-lists`, {}, qs); diff --git a/packages/nodes-base/nodes/Autopilot/Autopilot.node.ts b/packages/nodes-base/nodes/Autopilot/Autopilot.node.ts index 34b8fdb47d..84a5ed107a 100644 --- a/packages/nodes-base/nodes/Autopilot/Autopilot.node.ts +++ b/packages/nodes-base/nodes/Autopilot/Autopilot.node.ts @@ -192,7 +192,7 @@ export class Autopilot implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } responseData = await autopilotApiRequestAllItems.call( this, @@ -256,7 +256,7 @@ export class Autopilot implements INodeType { const listId = this.getNodeParameter('listId', i) as string; if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } responseData = await autopilotApiRequestAllItems.call( this, @@ -287,7 +287,7 @@ export class Autopilot implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } responseData = await autopilotApiRequest.call(this, 'GET', '/lists'); diff --git a/packages/nodes-base/nodes/Aws/CertificateManager/AwsCertificateManager.node.ts b/packages/nodes-base/nodes/Aws/CertificateManager/AwsCertificateManager.node.ts index 41bc367cf5..8e567e6572 100644 --- a/packages/nodes-base/nodes/Aws/CertificateManager/AwsCertificateManager.node.ts +++ b/packages/nodes-base/nodes/Aws/CertificateManager/AwsCertificateManager.node.ts @@ -107,11 +107,12 @@ export class AwsCertificateManager implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0); const options = this.getNodeParameter('options', i) as IDataObject; - const body: { Includes: IDataObject; CertificateStatuses: string[]; MaxItems: number } = { - CertificateStatuses: [], - Includes: {}, - MaxItems: 0, - }; + const body: { Includes: IDataObject; CertificateStatuses: string[]; MaxItems: number } = + { + CertificateStatuses: [], + Includes: {}, + MaxItems: 0, + }; if (options.certificateStatuses) { body.CertificateStatuses = options.certificateStatuses as string[]; @@ -144,7 +145,7 @@ export class AwsCertificateManager implements INodeType { }, ); } else { - body.MaxItems = this.getNodeParameter('limit', 0) as number; + body.MaxItems = this.getNodeParameter('limit', 0); responseData = await awsApiRequestREST.call( this, `acm`, diff --git a/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts b/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts index 108355162e..a2ebe45ef0 100644 --- a/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts +++ b/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts @@ -383,7 +383,7 @@ export class AwsDynamoDB implements INodeType { headers, ); } else { - body.Limit = this.getNodeParameter('limit', 0, 1) as number; + body.Limit = this.getNodeParameter('limit', 0, 1); responseData = await awsApiRequest.call(this, 'dynamodb', 'POST', '/', body, headers); if (select !== 'COUNT') { responseData = responseData.Items; diff --git a/packages/nodes-base/nodes/Aws/ELB/AwsElb.node.ts b/packages/nodes-base/nodes/Aws/ELB/AwsElb.node.ts index afe737f864..c517fc1055 100644 --- a/packages/nodes-base/nodes/Aws/ELB/AwsElb.node.ts +++ b/packages/nodes-base/nodes/Aws/ELB/AwsElb.node.ts @@ -266,7 +266,7 @@ export class AwsElb implements INodeType { '/?Action=DescribeListenerCertificates&' + params.join('&'), ); } else { - params.push(('PageSize=' + this.getNodeParameter('limit', 0)) as string); + params.push('PageSize=' + this.getNodeParameter('limit', 0)); responseData = await awsApiRequestSOAP.call( this, @@ -406,7 +406,7 @@ export class AwsElb implements INodeType { '/?Action=DescribeLoadBalancers&' + params.join('&'), ); } else { - params.push(('PageSize=' + this.getNodeParameter('limit', 0)) as string); + params.push('PageSize=' + this.getNodeParameter('limit', 0)); responseData = await awsApiRequestSOAP.call( this, diff --git a/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts b/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts index f106facb6f..32bbf39093 100644 --- a/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts +++ b/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts @@ -182,7 +182,7 @@ export class AwsS3 implements INodeType { '', ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await awsApiRequestSOAPAllItems.call( this, 'ListAllMyBucketsResult.Buckets.Bucket', @@ -249,7 +249,7 @@ export class AwsS3 implements INodeType { region, ); } else { - qs['max-keys'] = this.getNodeParameter('limit', 0) as number; + qs['max-keys'] = this.getNodeParameter('limit', 0); responseData = await awsApiRequestSOAP.call( this, `${bucketName}.s3`, @@ -424,7 +424,7 @@ export class AwsS3 implements INodeType { region, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await awsApiRequestSOAPAllItems.call( this, 'ListBucketResult.Contents', @@ -691,7 +691,7 @@ export class AwsS3 implements INodeType { region, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await awsApiRequestSOAPAllItems.call( this, 'ListBucketResult.Contents', diff --git a/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts b/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts index 014fb6dc88..c0cc7958af 100644 --- a/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts +++ b/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts @@ -920,7 +920,7 @@ export class AwsSes implements INodeType { '/?Action=ListCustomVerificationEmailTemplates', ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await awsApiRequestSOAP.call( this, @@ -1248,7 +1248,7 @@ export class AwsSes implements INodeType { '/?Action=ListTemplates', ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await awsApiRequestSOAP.call( this, diff --git a/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts b/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts index 48d4024aef..60b17682e2 100644 --- a/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts +++ b/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts @@ -514,7 +514,7 @@ export class AwsTranscribe implements INodeType { { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); body['MaxResults'] = limit; responseData = await awsApiRequestREST.call( this, diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts index cbab3f7232..6651151ca7 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts @@ -14,7 +14,7 @@ export async function getAll( //limit parameters const returnAll = this.getNodeParameter('returnAll', 0, false) as boolean; - const limit = this.getNodeParameter('limit', 0, 0) as number; + const limit = this.getNodeParameter('limit', 0, 0); //response const responseData = await apiRequest.call(this, requestMethod, endpoint, body); diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts index dbede13557..270adaead2 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts @@ -17,7 +17,7 @@ export async function getAll( //limit parameters const simplifyOutput: boolean = this.getNodeParameter('simplifyOutput', index) as boolean; const returnAll: boolean = this.getNodeParameter('returnAll', 0, false) as boolean; - const limit: number = this.getNodeParameter('limit', 0, 0) as number; + const limit: number = this.getNodeParameter('limit', 0, 0); //endpoint const endpoint = `employees/${id}/files/view/`; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts index 6fd312a50d..316ca33501 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts @@ -15,7 +15,7 @@ export async function getAll( //limit parameters const simplifyOutput: boolean = this.getNodeParameter('simplifyOutput', index) as boolean; const returnAll: boolean = this.getNodeParameter('returnAll', 0, false) as boolean; - const limit: number = this.getNodeParameter('limit', 0, 0) as number; + const limit: number = this.getNodeParameter('limit', 0, 0); //response const responseData = await apiRequest.call(this, requestMethod, endpoint, body); diff --git a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts index ed9a3ad3a4..0965477cb3 100644 --- a/packages/nodes-base/nodes/Baserow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Baserow/GenericFunctions.ts @@ -63,7 +63,7 @@ export async function baserowApiRequestAllItems( qs.size = 100; const returnAll = this.getNodeParameter('returnAll', 0, false) as boolean; - const limit = this.getNodeParameter('limit', 0, 0) as number; + const limit = this.getNodeParameter('limit', 0, 0); do { responseData = await baserowApiRequest.call(this, method, endpoint, body, qs, jwtToken); diff --git a/packages/nodes-base/nodes/Beeminder/Beeminder.node.ts b/packages/nodes-base/nodes/Beeminder/Beeminder.node.ts index 676a21f8fe..2adaf24f97 100644 --- a/packages/nodes-base/nodes/Beeminder/Beeminder.node.ts +++ b/packages/nodes-base/nodes/Beeminder/Beeminder.node.ts @@ -331,7 +331,7 @@ export class Beeminder implements INodeType { Object.assign(data, options); if (returnAll === false) { - data.count = this.getNodeParameter('limit', 0) as number; + data.count = this.getNodeParameter('limit', 0); } results = await getAllDatapoints.call(this, data); diff --git a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts index 08030bf02e..7bbf75d04f 100644 --- a/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Bitwarden/GenericFunctions.ts @@ -103,7 +103,7 @@ export async function handleGetAll( if (returnAll) { return responseData.data; } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); return responseData.data.slice(0, limit); } } diff --git a/packages/nodes-base/nodes/Box/Box.node.ts b/packages/nodes-base/nodes/Box/Box.node.ts index 91734cf76e..5c0550b1a1 100644 --- a/packages/nodes-base/nodes/Box/Box.node.ts +++ b/packages/nodes-base/nodes/Box/Box.node.ts @@ -215,7 +215,7 @@ export class Box implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await boxApiRequest.call(this, 'GET', `/search`, {}, qs); responseData = responseData.entries; } @@ -449,7 +449,7 @@ export class Box implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await boxApiRequest.call(this, 'GET', `/search`, {}, qs); responseData = responseData.entries; } diff --git a/packages/nodes-base/nodes/Bubble/Bubble.node.ts b/packages/nodes-base/nodes/Bubble/Bubble.node.ts index 500a4ea850..173bc1d9f3 100644 --- a/packages/nodes-base/nodes/Bubble/Bubble.node.ts +++ b/packages/nodes-base/nodes/Bubble/Bubble.node.ts @@ -148,7 +148,7 @@ export class Bubble implements INodeType { if (returnAll === true) { responseData = await bubbleApiRequestAllItems.call(this, 'GET', endpoint, {}, qs); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await bubbleApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.response.results; } diff --git a/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts b/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts index d0ab38b03e..58f5937bf9 100644 --- a/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts +++ b/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts @@ -97,7 +97,7 @@ export class CircleCi implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await circleciApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; responseData = responseData.splice(0, qs.limit); diff --git a/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts b/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts index 48d17ea34e..0c872d15b0 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts @@ -270,7 +270,7 @@ export class CiscoWebex implements INodeType { qs, ); } else { - qs.max = this.getNodeParameter('limit', i) as number; + qs.max = this.getNodeParameter('limit', i); responseData = await webexApiRequest.call(this, 'GET', '/messages', {}, qs); responseData = responseData.items; } @@ -429,7 +429,7 @@ export class CiscoWebex implements INodeType { qs, ); } else { - qs.max = this.getNodeParameter('limit', i) as number; + qs.max = this.getNodeParameter('limit', i); responseData = await webexApiRequest.call(this, 'GET', '/meetings', {}, qs); responseData = responseData.items; } @@ -554,7 +554,7 @@ export class CiscoWebex implements INodeType { // responseData = await webexApiRequestAllItems.call(this, 'items', 'GET', '/meetingTranscripts', {}, qs); // returnData.push(...responseData); // } else { - // qs.max = this.getNodeParameter('limit', i) as number; + // qs.max = this.getNodeParameter('limit', i); // responseData = await webexApiRequest.call(this, 'GET', '/meetingTranscripts', {}, qs); // returnData.push(...responseData.items); // } diff --git a/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts b/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts index 75c12c6eb1..72e3f9a932 100644 --- a/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts +++ b/packages/nodes-base/nodes/ClickUp/ClickUp.node.ts @@ -561,7 +561,7 @@ export class ClickUp implements INodeType { if (operation === 'getAll') { const resource = this.getNodeParameter('commentsOn', i) as string; const id = this.getNodeParameter('id', i) as string; - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clickupApiRequest.call( this, 'GET', @@ -618,7 +618,7 @@ export class ClickUp implements INodeType { if (filters.archived) { qs.archived = filters.archived as boolean; } - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clickupApiRequest.call( this, 'GET', @@ -679,7 +679,7 @@ export class ClickUp implements INodeType { } if (operation === 'getAll') { const teamId = this.getNodeParameter('team', i) as string; - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clickupApiRequest.call( this, 'GET', @@ -1087,7 +1087,7 @@ export class ClickUp implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clickupApiRequestAllItems.call( this, 'tasks', @@ -1112,7 +1112,7 @@ export class ClickUp implements INodeType { ); responseData = responseData.members; } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clickupApiRequest.call( this, 'GET', @@ -1298,7 +1298,7 @@ export class ClickUp implements INodeType { responseData = responseData.data; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -1420,7 +1420,7 @@ export class ClickUp implements INodeType { responseData = responseData.data; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -1477,7 +1477,7 @@ export class ClickUp implements INodeType { responseData = await clickupApiRequest.call(this, 'GET', `/space/${spaceId}/tag`); responseData = responseData.tags; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -1555,7 +1555,7 @@ export class ClickUp implements INodeType { ); responseData = responseData.members; } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clickupApiRequest.call( this, 'GET', @@ -1594,7 +1594,7 @@ export class ClickUp implements INodeType { endpoint = `/folder/${folderId}/list`; } - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clickupApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.lists; responseData = responseData.splice(0, qs.limit); diff --git a/packages/nodes-base/nodes/Clockify/Clockify.node.ts b/packages/nodes-base/nodes/Clockify/Clockify.node.ts index 51b10be8a2..1212b2efc1 100644 --- a/packages/nodes-base/nodes/Clockify/Clockify.node.ts +++ b/packages/nodes-base/nodes/Clockify/Clockify.node.ts @@ -337,7 +337,7 @@ export class Clockify implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clockifyApiRequestAllItems.call( this, @@ -427,7 +427,7 @@ export class Clockify implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clockifyApiRequestAllItems.call( this, @@ -521,7 +521,7 @@ export class Clockify implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clockifyApiRequestAllItems.call( this, @@ -638,7 +638,7 @@ export class Clockify implements INodeType { qs, ); } else { - qs['page-size'] = this.getNodeParameter('limit', i) as number; + qs['page-size'] = this.getNodeParameter('limit', i); responseData = await clockifyApiRequest.call( this, @@ -809,7 +809,7 @@ export class Clockify implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await clockifyApiRequestAllItems.call( this, @@ -829,7 +829,7 @@ export class Clockify implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); responseData = await clockifyApiRequest.call(this, 'GET', '/workspaces', {}, qs); if (!returnAll) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, qs.limit); } } diff --git a/packages/nodes-base/nodes/Cloudflare/Cloudflare.node.ts b/packages/nodes-base/nodes/Cloudflare/Cloudflare.node.ts index 2178b23fd0..e017d08be8 100644 --- a/packages/nodes-base/nodes/Cloudflare/Cloudflare.node.ts +++ b/packages/nodes-base/nodes/Cloudflare/Cloudflare.node.ts @@ -124,7 +124,7 @@ export class Cloudflare implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); Object.assign(qs, { per_page: limit }); responseData = await cloudflareApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Cockpit/Cockpit.node.ts b/packages/nodes-base/nodes/Cockpit/Cockpit.node.ts index 75bb29faef..e85ba87b2d 100644 --- a/packages/nodes-base/nodes/Cockpit/Cockpit.node.ts +++ b/packages/nodes-base/nodes/Cockpit/Cockpit.node.ts @@ -121,7 +121,7 @@ export class Cockpit implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - options.limit = this.getNodeParameter('limit', i) as number; + options.limit = this.getNodeParameter('limit', i); } responseData = await getAllCollectionEntries.call(this, collectionName, options); diff --git a/packages/nodes-base/nodes/Coda/Coda.node.ts b/packages/nodes-base/nodes/Coda/Coda.node.ts index 5010be2dd3..4c1c530685 100644 --- a/packages/nodes-base/nodes/Coda/Coda.node.ts +++ b/packages/nodes-base/nodes/Coda/Coda.node.ts @@ -392,7 +392,7 @@ export class Coda implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await codaApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; } @@ -510,7 +510,7 @@ export class Coda implements INodeType { if (returnAll) { responseData = await codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await codaApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; } @@ -572,7 +572,7 @@ export class Coda implements INodeType { if (returnAll) { responseData = await codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await codaApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; } @@ -634,7 +634,7 @@ export class Coda implements INodeType { if (returnAll) { responseData = await codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await codaApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; } @@ -684,7 +684,7 @@ export class Coda implements INodeType { if (returnAll) { responseData = await codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await codaApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; } @@ -738,7 +738,7 @@ export class Coda implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await codaApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; } @@ -828,7 +828,7 @@ export class Coda implements INodeType { if (returnAll) { responseData = await codaApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await codaApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items; } diff --git a/packages/nodes-base/nodes/CoinGecko/CoinGecko.node.ts b/packages/nodes-base/nodes/CoinGecko/CoinGecko.node.ts index 5ce1095f00..aff8934151 100644 --- a/packages/nodes-base/nodes/CoinGecko/CoinGecko.node.ts +++ b/packages/nodes-base/nodes/CoinGecko/CoinGecko.node.ts @@ -198,7 +198,7 @@ export class CoinGecko implements INodeType { responseData = await coinGeckoApiRequest.call(this, 'GET', '/coins/list', {}, qs); if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -227,7 +227,7 @@ export class CoinGecko implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; @@ -292,7 +292,7 @@ export class CoinGecko implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await coinGeckoApiRequest.call( this, @@ -425,7 +425,7 @@ export class CoinGecko implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; diff --git a/packages/nodes-base/nodes/Contentful/Contentful.node.ts b/packages/nodes-base/nodes/Contentful/Contentful.node.ts index 143d84a430..06658ea482 100644 --- a/packages/nodes-base/nodes/Contentful/Contentful.node.ts +++ b/packages/nodes-base/nodes/Contentful/Contentful.node.ts @@ -201,7 +201,7 @@ export class Contentful implements INodeType { responseData = assets; } } else { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); qs.limit = limit; responseData = await contentfulApiRequest.call( this, @@ -300,7 +300,7 @@ export class Contentful implements INodeType { responseData = assets; } } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await contentfulApiRequest.call( this, @@ -340,7 +340,7 @@ export class Contentful implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); qs.limit = limit; responseData = await contentfulApiRequest.call( this, diff --git a/packages/nodes-base/nodes/ConvertKit/ConvertKit.node.ts b/packages/nodes-base/nodes/ConvertKit/ConvertKit.node.ts index bfa1581f10..2a24ec613d 100644 --- a/packages/nodes-base/nodes/ConvertKit/ConvertKit.node.ts +++ b/packages/nodes-base/nodes/ConvertKit/ConvertKit.node.ts @@ -194,7 +194,7 @@ export class ConvertKit implements INodeType { responseData = responseData.custom_fields; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } @@ -261,7 +261,7 @@ export class ConvertKit implements INodeType { responseData = responseData.forms; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } @@ -288,7 +288,7 @@ export class ConvertKit implements INodeType { responseData = responseData.subscriptions; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } @@ -344,7 +344,7 @@ export class ConvertKit implements INodeType { responseData = responseData.courses; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } @@ -371,7 +371,7 @@ export class ConvertKit implements INodeType { responseData = responseData.subscriptions; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } @@ -399,7 +399,7 @@ export class ConvertKit implements INodeType { responseData = responseData.tags; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } @@ -458,7 +458,7 @@ export class ConvertKit implements INodeType { responseData = responseData.subscriptions; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Copper/GenericFunctions.ts b/packages/nodes-base/nodes/Copper/GenericFunctions.ts index 07e471a615..e5b86ea99d 100644 --- a/packages/nodes-base/nodes/Copper/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Copper/GenericFunctions.ts @@ -166,7 +166,7 @@ export async function handleListing( return await copperApiRequestAllItems.call(this, method, endpoint, body, qs, uri, option); } - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = await copperApiRequestAllItems.call(this, method, endpoint, body, qs, uri, option); return responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Demio/Demio.node.ts b/packages/nodes-base/nodes/Demio/Demio.node.ts index f3f35f3b45..0772ebaa90 100644 --- a/packages/nodes-base/nodes/Demio/Demio.node.ts +++ b/packages/nodes-base/nodes/Demio/Demio.node.ts @@ -139,7 +139,7 @@ export class Demio implements INodeType { responseData = await demioApiRequest.call(this, 'GET', `/events`, {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/Discourse/Discourse.node.ts b/packages/nodes-base/nodes/Discourse/Discourse.node.ts index 14e191da66..de5217b86a 100644 --- a/packages/nodes-base/nodes/Discourse/Discourse.node.ts +++ b/packages/nodes-base/nodes/Discourse/Discourse.node.ts @@ -144,7 +144,7 @@ export class Discourse implements INodeType { responseData = responseData.category_list.categories; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -204,7 +204,7 @@ export class Discourse implements INodeType { responseData = responseData.groups; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -248,7 +248,7 @@ export class Discourse implements INodeType { //https://docs.discourse.org/#tag/Posts/paths/~1posts.json/get if (operation === 'getAll') { const returnAll = this.getNodeParameter('returnAll', i); - const limit = this.getNodeParameter('limit', i, 0) as number; + const limit = this.getNodeParameter('limit', i, 0); responseData = await discourseApiRequest.call(this, 'GET', `/posts.json`, {}, qs); responseData = responseData.latest_posts; @@ -382,7 +382,7 @@ export class Discourse implements INodeType { ); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/Disqus/Disqus.node.ts b/packages/nodes-base/nodes/Disqus/Disqus.node.ts index 12b04d9ae6..ae920800c0 100644 --- a/packages/nodes-base/nodes/Disqus/Disqus.node.ts +++ b/packages/nodes-base/nodes/Disqus/Disqus.node.ts @@ -640,7 +640,7 @@ export class Disqus implements INodeType { endpoint, ); } else { - const limit = this.getNodeParameter('limit', i) as string; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await disqusApiRequest.call(this, requestMethod, qs, endpoint); } @@ -680,7 +680,7 @@ export class Disqus implements INodeType { endpoint, ); } else { - const limit = this.getNodeParameter('limit', i) as string; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = (await disqusApiRequest.call( this, @@ -726,7 +726,7 @@ export class Disqus implements INodeType { endpoint, ); } else { - const limit = this.getNodeParameter('limit', i) as string; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await disqusApiRequest.call(this, requestMethod, qs, endpoint); } diff --git a/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts b/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts index f2e455d571..7412bb3aeb 100644 --- a/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts +++ b/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts @@ -815,7 +815,7 @@ export class Dropbox implements INodeType { }; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); body.limit = limit; } @@ -852,7 +852,7 @@ export class Dropbox implements INodeType { Object.assign(body.options!, filters); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); Object.assign(body.options!, { max_results: limit }); } @@ -942,7 +942,7 @@ export class Dropbox implements INodeType { const newItem: INodeExecutionData = { json: items[i].json, binary: {}, - pairedItem: {item: i}, + pairedItem: { item: i }, }; if (items[i].binary !== undefined) { @@ -1000,9 +1000,9 @@ export class Dropbox implements INodeType { } else if (resource === 'search' && operation === 'query') { let data = responseData; if (returnAll === true) { - data = (simple === true) ? simplify(responseData) : responseData; + data = simple === true ? simplify(responseData) : responseData; } else { - data = (simple === true) ? simplify(responseData[property]) : responseData[property]; + data = simple === true ? simplify(responseData[property]) : responseData[property]; } const executionData = this.helpers.constructExecutionMetaData( @@ -1023,7 +1023,7 @@ export class Dropbox implements INodeType { if (resource === 'file' && operation === 'download') { items[i].json = { error: error.message }; } else { - returnData.push({json: { error: error.message }}); + returnData.push({ json: { error: error.message } }); } continue; } diff --git a/packages/nodes-base/nodes/ERPNext/ERPNext.node.ts b/packages/nodes-base/nodes/ERPNext/ERPNext.node.ts index ad09d8f92c..f53578a755 100644 --- a/packages/nodes-base/nodes/ERPNext/ERPNext.node.ts +++ b/packages/nodes-base/nodes/ERPNext/ERPNext.node.ts @@ -188,7 +188,7 @@ export class ERPNext implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit_page_length = limit; qs.limit_start = 0; responseData = await erpNextApiRequest.call(this, 'GET', endpoint, {}, qs); diff --git a/packages/nodes-base/nodes/Egoi/Egoi.node.ts b/packages/nodes-base/nodes/Egoi/Egoi.node.ts index 109eb75c4a..f336adcc56 100644 --- a/packages/nodes-base/nodes/Egoi/Egoi.node.ts +++ b/packages/nodes-base/nodes/Egoi/Egoi.node.ts @@ -661,7 +661,7 @@ export class Egoi implements INodeType { {}, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await egoiApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts index a4e3130758..b35c6a98b0 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts @@ -99,7 +99,7 @@ export async function handleListing( body, qs, ); - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); return responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts b/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts index 9c8da3fbd0..d16c1a7e2b 100644 --- a/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts +++ b/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts @@ -336,7 +336,7 @@ export class Elasticsearch implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } diff --git a/packages/nodes-base/nodes/Emelia/Emelia.node.ts b/packages/nodes-base/nodes/Emelia/Emelia.node.ts index 0606fc4835..b5a15053b2 100644 --- a/packages/nodes-base/nodes/Emelia/Emelia.node.ts +++ b/packages/nodes-base/nodes/Emelia/Emelia.node.ts @@ -247,7 +247,7 @@ export class Emelia implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); campaigns = campaigns.slice(0, limit); } @@ -418,7 +418,7 @@ export class Emelia implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); contactLists = contactLists.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Flow/Flow.node.ts b/packages/nodes-base/nodes/Flow/Flow.node.ts index 526971f997..deaca58ba3 100644 --- a/packages/nodes-base/nodes/Flow/Flow.node.ts +++ b/packages/nodes-base/nodes/Flow/Flow.node.ts @@ -252,7 +252,7 @@ export class Flow implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await flowApiRequest.call(this, 'GET', '/tasks', {}, qs); responseData = responseData.tasks; } diff --git a/packages/nodes-base/nodes/Freshdesk/Freshdesk.node.ts b/packages/nodes-base/nodes/Freshdesk/Freshdesk.node.ts index b7293b9671..8af53ee4f1 100644 --- a/packages/nodes-base/nodes/Freshdesk/Freshdesk.node.ts +++ b/packages/nodes-base/nodes/Freshdesk/Freshdesk.node.ts @@ -1319,7 +1319,7 @@ export class Freshdesk implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await freshdeskApiRequest.call(this, 'GET', '/tickets', {}, qs); } } diff --git a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts index b2ce3a411d..fc80796075 100644 --- a/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Freshservice/GenericFunctions.ts @@ -106,7 +106,7 @@ export async function handleListing( } const responseData = await freshserviceApiRequestAllItems.call(this, method, endpoint, body, qs); - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); return responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts b/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts index be638a67e6..63b9aa8105 100644 --- a/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts +++ b/packages/nodes-base/nodes/GetResponse/GetResponse.node.ts @@ -261,7 +261,7 @@ export class GetResponse implements INodeType { qs, ); } else { - qs.perPage = this.getNodeParameter('limit', i) as number; + qs.perPage = this.getNodeParameter('limit', i); responseData = await getresponseApiRequest.call(this, 'GET', `/contacts`, {}, qs); } } diff --git a/packages/nodes-base/nodes/Git/Git.node.ts b/packages/nodes-base/nodes/Git/Git.node.ts index bd71f8aa99..dc6225f2aa 100644 --- a/packages/nodes-base/nodes/Git/Git.node.ts +++ b/packages/nodes-base/nodes/Git/Git.node.ts @@ -342,7 +342,7 @@ export class Git implements INodeType { const returnAll = this.getNodeParameter('returnAll', itemIndex, false) as boolean; if (returnAll === false) { - logOptions.maxCount = this.getNodeParameter('limit', itemIndex, 100) as number; + logOptions.maxCount = this.getNodeParameter('limit', itemIndex, 100); } if (options.file) { logOptions.file = options.file as string; diff --git a/packages/nodes-base/nodes/Github/Github.node.ts b/packages/nodes-base/nodes/Github/Github.node.ts index afc4451372..b4f8479311 100644 --- a/packages/nodes-base/nodes/Github/Github.node.ts +++ b/packages/nodes-base/nodes/Github/Github.node.ts @@ -1934,7 +1934,7 @@ export class Github implements INodeType { returnAll = this.getNodeParameter('returnAll', 0); if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); } } if (operation === 'update') { @@ -1997,7 +1997,7 @@ export class Github implements INodeType { returnAll = this.getNodeParameter('returnAll', 0); if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); } } } else if (resource === 'review') { @@ -2023,7 +2023,7 @@ export class Github implements INodeType { const pullRequestNumber = this.getNodeParameter('pullRequestNumber', i) as string; if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); } endpoint = `/repos/${owner}/${repository}/pulls/${pullRequestNumber}/reviews`; @@ -2069,7 +2069,7 @@ export class Github implements INodeType { returnAll = this.getNodeParameter('returnAll', 0); if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); } } else if (operation === 'invite') { // ---------------------------------- @@ -2093,7 +2093,7 @@ export class Github implements INodeType { returnAll = this.getNodeParameter('returnAll', 0); if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); } } } else { diff --git a/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts b/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts index a2802e5c57..9ea0134a1b 100644 --- a/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts +++ b/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts @@ -1178,7 +1178,7 @@ export class Gitlab implements INodeType { returnAll = this.getNodeParameter('returnAll', 0); if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); } endpoint = `/projects/${id}/releases`; diff --git a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts index e3164cf8e0..579b3d7f09 100644 --- a/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts @@ -126,7 +126,7 @@ export async function handleGetAll( const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); } return await goToWebinarApiRequestAllItems.call(this, 'GET', endpoint, qs, body, resource); diff --git a/packages/nodes-base/nodes/GoToWebinar/GoToWebinar.node.ts b/packages/nodes-base/nodes/GoToWebinar/GoToWebinar.node.ts index de9dbd9081..6ce82508f1 100644 --- a/packages/nodes-base/nodes/GoToWebinar/GoToWebinar.node.ts +++ b/packages/nodes-base/nodes/GoToWebinar/GoToWebinar.node.ts @@ -446,7 +446,7 @@ export class GoToWebinar implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); } const { webinarKey, times } = this.getNodeParameter('additionalFields', i) as { @@ -566,7 +566,7 @@ export class GoToWebinar implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); } const { times } = this.getNodeParameter('additionalFields', i) as { diff --git a/packages/nodes-base/nodes/Google/Analytics/GoogleAnalytics.node.ts b/packages/nodes-base/nodes/Google/Analytics/GoogleAnalytics.node.ts index f541cdbbb2..0552be0bf3 100644 --- a/packages/nodes-base/nodes/Google/Analytics/GoogleAnalytics.node.ts +++ b/packages/nodes-base/nodes/Google/Analytics/GoogleAnalytics.node.ts @@ -270,7 +270,7 @@ export class GoogleAnalytics implements INodeType { body, ); } else { - body.pageSize = this.getNodeParameter('limit', 0) as number; + body.pageSize = this.getNodeParameter('limit', 0); responseData = await googleApiRequest.call(this, method, endpoint, body); responseData = responseData.sessions; } diff --git a/packages/nodes-base/nodes/Google/BigQuery/GoogleBigQuery.node.ts b/packages/nodes-base/nodes/Google/BigQuery/GoogleBigQuery.node.ts index 6434b86efb..ebde60c4cd 100644 --- a/packages/nodes-base/nodes/Google/BigQuery/GoogleBigQuery.node.ts +++ b/packages/nodes-base/nodes/Google/BigQuery/GoogleBigQuery.node.ts @@ -249,7 +249,7 @@ export class GoogleBigQuery implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts b/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts index 058ce1bc9e..d9756e2aa5 100644 --- a/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts +++ b/packages/nodes-base/nodes/Google/Books/GoogleBooks.node.ts @@ -368,7 +368,7 @@ export class GoogleBooks implements INodeType { {}, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -413,7 +413,7 @@ export class GoogleBooks implements INodeType { {}, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items || []; } @@ -464,7 +464,7 @@ export class GoogleBooks implements INodeType { {}, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.items || []; } diff --git a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts index a2ff976ec7..f4d3e9faa6 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts @@ -432,7 +432,7 @@ export class GoogleCalendar implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Google/Chat/GoogleChat.node.ts b/packages/nodes-base/nodes/Google/Chat/GoogleChat.node.ts index 62cb64fbcb..9582602da5 100644 --- a/packages/nodes-base/nodes/Google/Chat/GoogleChat.node.ts +++ b/packages/nodes-base/nodes/Google/Chat/GoogleChat.node.ts @@ -277,7 +277,7 @@ export class GoogleChat implements INodeType { `/v1/spaces`, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.pageSize = limit; responseData = await googleApiRequest.call(this, 'GET', `/v1/spaces`, undefined, qs); @@ -315,7 +315,7 @@ export class GoogleChat implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.pageSize = limit; responseData = await googleApiRequest.call( diff --git a/packages/nodes-base/nodes/Google/Contacts/GoogleContacts.node.ts b/packages/nodes-base/nodes/Google/Contacts/GoogleContacts.node.ts index bed304f0ea..568e5211d3 100644 --- a/packages/nodes-base/nodes/Google/Contacts/GoogleContacts.node.ts +++ b/packages/nodes-base/nodes/Google/Contacts/GoogleContacts.node.ts @@ -304,7 +304,7 @@ export class GoogleContacts implements INodeType { responseData = responseData.map((result: IDataObject) => result.person); } } else { - qs.pageSize = this.getNodeParameter('limit', i) as number; + qs.pageSize = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call(this, 'GET', `/people${endpoint}`, {}, qs); responseData = diff --git a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts index 260843ff19..d64ab68701 100644 --- a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts +++ b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts @@ -2216,7 +2216,7 @@ export class GoogleDrive implements INodeType { qs, ); } else { - qs.pageSize = this.getNodeParameter('limit', i) as number; + qs.pageSize = this.getNodeParameter('limit', i); const data = await googleApiRequest.call(this, 'GET', `/drive/v3/drives`, {}, qs); response = data.drives as IDataObject[]; } @@ -2477,7 +2477,7 @@ export class GoogleDrive implements INodeType { } } - const pageSize = this.getNodeParameter('limit', i) as number; + const pageSize = this.getNodeParameter('limit', i); const qs = { pageSize, diff --git a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts index e42b4494d8..fc5885331d 100644 --- a/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts +++ b/packages/nodes-base/nodes/Google/Firebase/CloudFirestore/GoogleFirebaseCloudFirestore.node.ts @@ -192,7 +192,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType { `/${projectId}/databases/${database}/documents/${collection}`, ); } else { - const limit = this.getNodeParameter('limit', 0) as string; + const limit = this.getNodeParameter('limit', 0); const getAllResponse = (await googleApiRequest.call( this, 'GET', @@ -386,7 +386,7 @@ export class GoogleFirebaseCloudFirestore implements INodeType { // @ts-ignore responseData = getAllResponse.map((o) => ({ name: o })); } else { - const limit = this.getNodeParameter('limit', 0) as string; + const limit = this.getNodeParameter('limit', 0); const getAllResponse = (await googleApiRequest.call( this, 'POST', diff --git a/packages/nodes-base/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.ts b/packages/nodes-base/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.ts index 6967eb2ef6..8ac5dab054 100644 --- a/packages/nodes-base/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.ts +++ b/packages/nodes-base/nodes/Google/GSuiteAdmin/GSuiteAdmin.node.ts @@ -180,7 +180,7 @@ export class GSuiteAdmin implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call(this, 'GET', `/directory/v1/groups`, {}, qs); @@ -350,7 +350,7 @@ export class GSuiteAdmin implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call(this, 'GET', `/directory/v1/users`, {}, qs); diff --git a/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts b/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts index 45f8ccf905..5fbed1684b 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v1/GmailV1.node.ts @@ -1,7 +1,5 @@ /* eslint-disable n8n-nodes-base/node-filename-against-convention */ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IBinaryKeyData, @@ -23,29 +21,15 @@ import { parseRawEmail, } from '../GenericFunctions'; -import { - messageFields, - messageOperations, -} from './MessageDescription'; +import { messageFields, messageOperations } from './MessageDescription'; -import { - messageLabelFields, - messageLabelOperations, -} from './MessageLabelDescription'; +import { messageLabelFields, messageLabelOperations } from './MessageLabelDescription'; -import { - labelFields, - labelOperations, -} from './LabelDescription'; +import { labelFields, labelOperations } from './LabelDescription'; -import { - draftFields, - draftOperations, -} from './DraftDescription'; +import { draftFields, draftOperations } from './DraftDescription'; -import { - isEmpty, -} from 'lodash'; +import { isEmpty } from 'lodash'; const versionDescription: INodeTypeDescription = { displayName: 'Gmail', @@ -66,9 +50,7 @@ const versionDescription: INodeTypeDescription = { required: true, displayOptions: { show: { - authentication: [ - 'serviceAccount', - ], + authentication: ['serviceAccount'], }, }, }, @@ -77,9 +59,7 @@ const versionDescription: INodeTypeDescription = { required: true, displayOptions: { show: { - authentication: [ - 'oAuth2', - ], + authentication: ['oAuth2'], }, }, }, @@ -165,9 +145,7 @@ export class GmailV1 implements INodeType { loadOptions: { // Get all the labels to display them to user so that he can // select them easily - async getLabels( - this: ILoadOptionsFunctions, - ): Promise { + async getLabels(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; const labels = await googleApiRequestAllItems.call( this, @@ -182,8 +160,12 @@ export class GmailV1 implements INodeType { }); } return returnData.sort((a, b) => { - if (a.name < b.name) { return -1; } - if (a.name > b.name) { return 1; } + if (a.name < b.name) { + return -1; + } + if (a.name > b.name) { + return 1; + } return 0; }); }, @@ -209,7 +191,10 @@ export class GmailV1 implements INodeType { //https://developers.google.com/gmail/api/v1/reference/users/labels/create const labelName = this.getNodeParameter('name', i) as string; const labelListVisibility = this.getNodeParameter('labelListVisibility', i) as string; - const messageListVisibility = this.getNodeParameter('messageListVisibility', i) as string; + const messageListVisibility = this.getNodeParameter( + 'messageListVisibility', + i, + ) as string; method = 'POST'; endpoint = '/gmail/v1/users/me/labels'; @@ -230,7 +215,6 @@ export class GmailV1 implements INodeType { endpoint = `/gmail/v1/users/me/labels/${labelId}`; responseData = await googleApiRequest.call(this, method, endpoint, body, qs); responseData = { success: true }; - } if (operation === 'get') { // https://developers.google.com/gmail/api/v1/reference/users/labels/get @@ -255,7 +239,7 @@ export class GmailV1 implements INodeType { responseData = responseData.labels; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -325,15 +309,20 @@ export class GmailV1 implements INodeType { const attachmentsUi = additionalFields.attachmentsUi as IDataObject; const attachmentsBinary = []; if (!isEmpty(attachmentsUi)) { - if (attachmentsUi.hasOwnProperty('attachmentsBinary') - && !isEmpty(attachmentsUi.attachmentsBinary) - && items[i].binary) { + if ( + attachmentsUi.hasOwnProperty('attachmentsBinary') && + !isEmpty(attachmentsUi.attachmentsBinary) && + items[i].binary + ) { // @ts-ignore for (const { property } of attachmentsUi.attachmentsBinary as IDataObject[]) { for (const binaryProperty of (property as string).split(',')) { if (items[i].binary![binaryProperty] !== undefined) { const binaryData = items[i].binary![binaryProperty]; - const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty); + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer( + i, + binaryProperty, + ); attachmentsBinary.push({ name: binaryData.fileName || 'unknown', content: binaryDataBuffer, @@ -353,7 +342,7 @@ export class GmailV1 implements INodeType { } const email: IEmail = { - from: additionalFields.senderName as string || '', + from: (additionalFields.senderName as string) || '', to: toStr, cc: ccStr, bcc: bccStr, @@ -362,7 +351,7 @@ export class GmailV1 implements INodeType { attachments: attachmentsList, }; - if (this.getNodeParameter('includeHtml', i, false) as boolean === true) { + if ((this.getNodeParameter('includeHtml', i, false) as boolean) === true) { email.htmlBody = this.getNodeParameter('htmlMessage', i) as string; } @@ -376,7 +365,6 @@ export class GmailV1 implements INodeType { responseData = await googleApiRequest.call(this, method, endpoint, body, qs); } if (operation === 'reply') { - const id = this.getNodeParameter('messageId', i) as string; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; @@ -411,15 +399,20 @@ export class GmailV1 implements INodeType { const attachmentsUi = additionalFields.attachmentsUi as IDataObject; const attachmentsBinary = []; if (!isEmpty(attachmentsUi)) { - if (attachmentsUi.hasOwnProperty('attachmentsBinary') - && !isEmpty(attachmentsUi.attachmentsBinary) - && items[i].binary) { + if ( + attachmentsUi.hasOwnProperty('attachmentsBinary') && + !isEmpty(attachmentsUi.attachmentsBinary) && + items[i].binary + ) { // @ts-ignore for (const { property } of attachmentsUi.attachmentsBinary as IDataObject[]) { for (const binaryProperty of (property as string).split(',')) { if (items[i].binary![binaryProperty] !== undefined) { const binaryData = items[i].binary![binaryProperty]; - const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty); + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer( + i, + binaryProperty, + ); attachmentsBinary.push({ name: binaryData.fileName || 'unknown', content: binaryDataBuffer, @@ -453,11 +446,17 @@ export class GmailV1 implements INodeType { } } - const subject = payload.headers.filter((data: { [key: string]: string }) => data.name === 'Subject')[0]?.value || ''; - const references = payload.headers.filter((data: { [key: string]: string }) => data.name === 'References')[0]?.value || ''; + const subject = + payload.headers.filter( + (data: { [key: string]: string }) => data.name === 'Subject', + )[0]?.value || ''; + const references = + payload.headers.filter( + (data: { [key: string]: string }) => data.name === 'References', + )[0]?.value || ''; const email: IEmail = { - from: additionalFields.senderName as string || '', + from: (additionalFields.senderName as string) || '', to: toStr, cc: ccStr, bcc: bccStr, @@ -466,7 +465,7 @@ export class GmailV1 implements INodeType { attachments: attachmentsList, }; - if (this.getNodeParameter('includeHtml', i, false) as boolean === true) { + if ((this.getNodeParameter('includeHtml', i, false) as boolean) === true) { email.htmlBody = this.getNodeParameter('htmlMessage', i) as string; } @@ -504,9 +503,14 @@ export class GmailV1 implements INodeType { let nodeExecutionData: INodeExecutionData; if (format === 'resolved') { - const dataPropertyNameDownload = additionalFields.dataPropertyAttachmentsPrefixName as string || 'attachment_'; + const dataPropertyNameDownload = + (additionalFields.dataPropertyAttachmentsPrefixName as string) || 'attachment_'; - nodeExecutionData = await parseRawEmail.call(this, responseData, dataPropertyNameDownload); + nodeExecutionData = await parseRawEmail.call( + this, + responseData, + dataPropertyNameDownload, + ); } else { nodeExecutionData = { json: responseData, @@ -539,7 +543,7 @@ export class GmailV1 implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -557,7 +561,6 @@ export class GmailV1 implements INodeType { const format = additionalFields.format || 'resolved'; if (format !== 'ids') { - if (format === 'resolved') { qs.format = 'raw'; } else { @@ -574,9 +577,14 @@ export class GmailV1 implements INodeType { ); if (format === 'resolved') { - const dataPropertyNameDownload = additionalFields.dataPropertyAttachmentsPrefixName as string || 'attachment_'; + const dataPropertyNameDownload = + (additionalFields.dataPropertyAttachmentsPrefixName as string) || 'attachment_'; - responseData[i] = await parseRawEmail.call(this, responseData[i], dataPropertyNameDownload); + responseData[i] = await parseRawEmail.call( + this, + responseData[i], + dataPropertyNameDownload, + ); } } } @@ -584,7 +592,6 @@ export class GmailV1 implements INodeType { if (format !== 'resolved') { responseData = this.helpers.returnJsonArray(responseData); } - } if (operation === 'delete') { // https://developers.google.com/gmail/api/v1/reference/users/messages/delete @@ -638,14 +645,19 @@ export class GmailV1 implements INodeType { const attachmentsBinary = []; if (!isEmpty(attachmentsUi)) { if (!isEmpty(attachmentsUi)) { - if (attachmentsUi.hasOwnProperty('attachmentsBinary') - && !isEmpty(attachmentsUi.attachmentsBinary) - && items[i].binary) { + if ( + attachmentsUi.hasOwnProperty('attachmentsBinary') && + !isEmpty(attachmentsUi.attachmentsBinary) && + items[i].binary + ) { for (const { property } of attachmentsUi.attachmentsBinary as IDataObject[]) { for (const binaryProperty of (property as string).split(',')) { if (items[i].binary![binaryProperty] !== undefined) { const binaryData = items[i].binary![binaryProperty]; - const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryProperty); + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer( + i, + binaryProperty, + ); attachmentsBinary.push({ name: binaryData.fileName || 'unknown', content: binaryDataBuffer, @@ -675,7 +687,7 @@ export class GmailV1 implements INodeType { attachments: attachmentsList, }; - if (this.getNodeParameter('includeHtml', i, false) as boolean === true) { + if ((this.getNodeParameter('includeHtml', i, false) as boolean) === true) { email.htmlBody = this.getNodeParameter('htmlMessage', i) as string; } @@ -712,9 +724,14 @@ export class GmailV1 implements INodeType { let nodeExecutionData: INodeExecutionData; if (format === 'resolved') { - const dataPropertyNameDownload = additionalFields.dataPropertyAttachmentsPrefixName as string || 'attachment_'; + const dataPropertyNameDownload = + (additionalFields.dataPropertyAttachmentsPrefixName as string) || 'attachment_'; - nodeExecutionData = await parseRawEmail.call(this, responseData.message, dataPropertyNameDownload); + nodeExecutionData = await parseRawEmail.call( + this, + responseData.message, + dataPropertyNameDownload, + ); // Add the draft-id nodeExecutionData.json.messageId = nodeExecutionData.json.id; @@ -754,7 +771,7 @@ export class GmailV1 implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -779,7 +796,6 @@ export class GmailV1 implements INodeType { } for (let i = 0; i < responseData.length; i++) { - responseData[i] = await googleApiRequest.call( this, 'GET', @@ -789,9 +805,14 @@ export class GmailV1 implements INodeType { ); if (format === 'resolved') { - const dataPropertyNameDownload = additionalFields.dataPropertyAttachmentsPrefixName as string || 'attachment_'; + const dataPropertyNameDownload = + (additionalFields.dataPropertyAttachmentsPrefixName as string) || 'attachment_'; const id = responseData[i].id; - responseData[i] = await parseRawEmail.call(this, responseData[i].message, dataPropertyNameDownload); + responseData[i] = await parseRawEmail.call( + this, + responseData[i].message, + dataPropertyNameDownload, + ); // Add the draft-id responseData[i].json.messageId = responseData[i].json.id; diff --git a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts index 0d87ea11a7..952653a300 100644 --- a/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts +++ b/packages/nodes-base/nodes/Google/Gmail/v2/GmailV2.node.ts @@ -265,7 +265,7 @@ export class GmailV2 implements INodeType { responseData = this.helpers.returnJsonArray(responseData.labels); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -395,7 +395,7 @@ export class GmailV2 implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -620,7 +620,7 @@ export class GmailV2 implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -720,7 +720,7 @@ export class GmailV2 implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts b/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts index a510e25902..32b618ad87 100644 --- a/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts +++ b/packages/nodes-base/nodes/Google/Slides/GoogleSlides.node.ts @@ -521,7 +521,7 @@ export class GoogleSlides implements INodeType { ); responseData = responseData.slides; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts index b485c7cd91..d049d6305d 100644 --- a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts +++ b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts @@ -196,7 +196,7 @@ export class GoogleTasks implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Google/YouTube/YouTube.node.ts b/packages/nodes-base/nodes/Google/YouTube/YouTube.node.ts index 530ff3518c..413c92eb96 100644 --- a/packages/nodes-base/nodes/Google/YouTube/YouTube.node.ts +++ b/packages/nodes-base/nodes/Google/YouTube/YouTube.node.ts @@ -262,7 +262,7 @@ export class YouTube implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -505,7 +505,7 @@ export class YouTube implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -686,7 +686,7 @@ export class YouTube implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call( this, 'GET', @@ -808,7 +808,7 @@ export class YouTube implements INodeType { qs, ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await googleApiRequest.call(this, 'GET', `/youtube/v3/search`, {}, qs); responseData = responseData.items; } @@ -1092,7 +1092,7 @@ export class YouTube implements INodeType { responseData = responseData.items; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/Gotify/Gotify.node.ts b/packages/nodes-base/nodes/Gotify/Gotify.node.ts index cabf035e8e..089a7bb4e1 100644 --- a/packages/nodes-base/nodes/Gotify/Gotify.node.ts +++ b/packages/nodes-base/nodes/Gotify/Gotify.node.ts @@ -201,7 +201,7 @@ export class Gotify implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await gotifyApiRequest.call(this, 'GET', `/message`, {}, qs); responseData = responseData.messages; } @@ -213,10 +213,9 @@ export class Gotify implements INodeType { { itemData: { item: i } }, ); returnData.push(...executionData); - } catch (error) { if (this.continueOnFail()) { - returnData.push({json:{ error: error.message }}); + returnData.push({ json: { error: error.message } }); continue; } throw error; diff --git a/packages/nodes-base/nodes/Grafana/Grafana.node.ts b/packages/nodes-base/nodes/Grafana/Grafana.node.ts index ade6d7d3be..c265b76283 100644 --- a/packages/nodes-base/nodes/Grafana/Grafana.node.ts +++ b/packages/nodes-base/nodes/Grafana/Grafana.node.ts @@ -200,7 +200,7 @@ export class Grafana implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); Object.assign(qs, { limit }); } @@ -324,7 +324,7 @@ export class Grafana implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } else if (operation === 'update') { @@ -407,7 +407,7 @@ export class Grafana implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } @@ -450,7 +450,7 @@ export class Grafana implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } else if (operation === 'update') { diff --git a/packages/nodes-base/nodes/Grist/Grist.node.ts b/packages/nodes-base/nodes/Grist/Grist.node.ts index 520e18ef15..3f35bb6e4b 100644 --- a/packages/nodes-base/nodes/Grist/Grist.node.ts +++ b/packages/nodes-base/nodes/Grist/Grist.node.ts @@ -223,7 +223,7 @@ export class Grist implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const { sort, filter } = this.getNodeParameter( diff --git a/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts index 94c72e993c..805956c755 100644 --- a/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts +++ b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts @@ -289,7 +289,7 @@ export class HackerNews implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - qs.hitsPerPage = this.getNodeParameter('limit', i) as number; + qs.hitsPerPage = this.getNodeParameter('limit', i); } endpoint = 'search?'; diff --git a/packages/nodes-base/nodes/HaloPSA/HaloPSA.node.ts b/packages/nodes-base/nodes/HaloPSA/HaloPSA.node.ts index f80c905a23..afcdad4a2e 100644 --- a/packages/nodes-base/nodes/HaloPSA/HaloPSA.node.ts +++ b/packages/nodes-base/nodes/HaloPSA/HaloPSA.node.ts @@ -301,7 +301,7 @@ export class HaloPSA implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.count = limit; const { clients } = await haloPSAApiRequest.call( this, @@ -409,7 +409,7 @@ export class HaloPSA implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.count = limit; const { sites } = await haloPSAApiRequest.call( this, @@ -519,7 +519,7 @@ export class HaloPSA implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.count = limit; const { tickets } = await haloPSAApiRequest.call( this, @@ -628,7 +628,7 @@ export class HaloPSA implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.count = limit; const { users } = await haloPSAApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts index 97a170a3ae..fdf2dbfb93 100644 --- a/packages/nodes-base/nodes/Harvest/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Harvest/GenericFunctions.ts @@ -110,7 +110,7 @@ export async function getAllResource( resource, ); } else { - const limit = this.getNodeParameter('limit', i) as string; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; responseData = await harvestApiRequest.call(this, requestMethod, qs, endpoint); } diff --git a/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts b/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts index cac556f130..9d21b15ec5 100644 --- a/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts +++ b/packages/nodes-base/nodes/HelpScout/HelpScout.node.ts @@ -259,7 +259,7 @@ export class HelpScout implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await helpscoutApiRequestAllItems.call( this, '_embedded.conversations', @@ -373,7 +373,7 @@ export class HelpScout implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await helpscoutApiRequestAllItems.call( this, '_embedded.customers', @@ -436,7 +436,7 @@ export class HelpScout implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await helpscoutApiRequestAllItems.call( this, '_embedded.mailboxes', @@ -544,7 +544,7 @@ export class HelpScout implements INodeType { `/v2/conversations/${conversationId}/threads`, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await helpscoutApiRequestAllItems.call( this, '_embedded.threads', diff --git a/packages/nodes-base/nodes/HomeAssistant/HomeAssistant.node.ts b/packages/nodes-base/nodes/HomeAssistant/HomeAssistant.node.ts index 91b04a820b..4c45690e79 100644 --- a/packages/nodes-base/nodes/HomeAssistant/HomeAssistant.node.ts +++ b/packages/nodes-base/nodes/HomeAssistant/HomeAssistant.node.ts @@ -207,7 +207,7 @@ export class HomeAssistant implements INodeType { '/services', )) as IDataObject[]; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } else if (operation === 'call') { @@ -247,7 +247,7 @@ export class HomeAssistant implements INodeType { '/states', )) as IDataObject[]; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } else if (operation === 'get') { @@ -290,7 +290,7 @@ export class HomeAssistant implements INodeType { '/events', )) as IDataObject[]; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } else if (operation === 'create') { @@ -385,7 +385,7 @@ export class HomeAssistant implements INodeType { qs, )) as IDataObject[]; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } } diff --git a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts index 8e2486627e..75f8dcbc32 100644 --- a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts +++ b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts @@ -1363,7 +1363,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', 0) as number; + qs.count = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.contacts; } @@ -1398,7 +1398,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', 0) as number; + qs.count = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.contacts; } @@ -1458,7 +1458,7 @@ export class Hubspot implements INodeType { qs, ); } else { - body.limit = this.getNodeParameter('limit', 0) as number; + body.limit = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'POST', endpoint, body, qs); responseData = responseData.results; } @@ -1952,7 +1952,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.companies; } @@ -1980,7 +1980,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', 0) as number; + qs.count = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.results; } @@ -2006,7 +2006,7 @@ export class Hubspot implements INodeType { body, ); } else { - body.limit = this.getNodeParameter('limit', 0) as number; + body.limit = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'POST', endpoint, body); responseData = responseData.results; } @@ -2190,7 +2190,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.deals; } @@ -2220,7 +2220,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', 0) as number; + qs.count = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.results; } @@ -2279,7 +2279,7 @@ export class Hubspot implements INodeType { qs, ); } else { - body.limit = this.getNodeParameter('limit', 0) as number; + body.limit = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'POST', endpoint, body, qs); responseData = responseData.results; } @@ -2365,7 +2365,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.results; } @@ -2593,7 +2593,7 @@ export class Hubspot implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await hubspotApiRequestAllItems.call( this, 'objects', diff --git a/packages/nodes-base/nodes/Hunter/Hunter.node.ts b/packages/nodes-base/nodes/Hunter/Hunter.node.ts index a97ebf16b6..96f1cdb313 100644 --- a/packages/nodes-base/nodes/Hunter/Hunter.node.ts +++ b/packages/nodes-base/nodes/Hunter/Hunter.node.ts @@ -321,7 +321,7 @@ export class Hunter implements INodeType { responseData = tempReturnData; } } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await hunterApiRequest.call(this, 'GET', '/domain-search', {}, qs); responseData = responseData.data; diff --git a/packages/nodes-base/nodes/Intercom/Intercom.node.ts b/packages/nodes-base/nodes/Intercom/Intercom.node.ts index 7f09d541ac..9c6df619bc 100644 --- a/packages/nodes-base/nodes/Intercom/Intercom.node.ts +++ b/packages/nodes-base/nodes/Intercom/Intercom.node.ts @@ -244,7 +244,7 @@ export class Intercom implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await intercomApiRequest.call(this, '/contacts', 'GET', {}, qs); responseData = responseData.contacts; } @@ -419,7 +419,7 @@ export class Intercom implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await intercomApiRequest.call(this, '/users', 'GET', {}, qs); responseData = responseData.users; } @@ -543,7 +543,7 @@ export class Intercom implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await intercomApiRequest.call(this, '/companies', 'GET', {}, qs); responseData = responseData.companies; } @@ -576,7 +576,7 @@ export class Intercom implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await intercomApiRequest.call( this, `/companies/${value}/users`, @@ -599,7 +599,7 @@ export class Intercom implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await intercomApiRequest.call(this, '/companies', 'GET', {}, qs); responseData = responseData.users; } diff --git a/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts b/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts index 0512042643..20cc53b6d1 100644 --- a/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts +++ b/packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts @@ -378,7 +378,7 @@ export class InvoiceNinja implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); responseData = await invoiceNinjaApiRequest.call(this, 'GET', '/clients', {}, qs); responseData = responseData.data; } @@ -539,7 +539,7 @@ export class InvoiceNinja implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); responseData = await invoiceNinjaApiRequest.call(this, 'GET', '/invoices', {}, qs); responseData = responseData.data; } @@ -632,7 +632,7 @@ export class InvoiceNinja implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); responseData = await invoiceNinjaApiRequest.call(this, 'GET', '/tasks', {}, qs); responseData = responseData.data; } @@ -704,7 +704,7 @@ export class InvoiceNinja implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); responseData = await invoiceNinjaApiRequest.call(this, 'GET', '/payments', {}, qs); responseData = responseData.data; } @@ -805,7 +805,7 @@ export class InvoiceNinja implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); responseData = await invoiceNinjaApiRequest.call(this, 'GET', '/expenses', {}, qs); responseData = responseData.data; } @@ -969,7 +969,7 @@ export class InvoiceNinja implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', 0) as number; + qs.per_page = this.getNodeParameter('limit', 0); responseData = await invoiceNinjaApiRequest.call(this, 'GET', '/quotes', {}, qs); responseData = responseData.data; } diff --git a/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts b/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts index b7e3cc7f94..79c6657c47 100644 --- a/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts +++ b/packages/nodes-base/nodes/Jenkins/Jenkins.node.ts @@ -628,7 +628,7 @@ export class Jenkins implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); endpoint += `{0,${limit}}`; } diff --git a/packages/nodes-base/nodes/Jira/Jira.node.ts b/packages/nodes-base/nodes/Jira/Jira.node.ts index aaa8055c50..3f3035c2c3 100644 --- a/packages/nodes-base/nodes/Jira/Jira.node.ts +++ b/packages/nodes-base/nodes/Jira/Jira.node.ts @@ -759,7 +759,7 @@ export class Jira implements INodeType { body, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); body.maxResults = limit; responseData = await jiraSoftwareCloudApiRequest.call( this, @@ -791,7 +791,7 @@ export class Jira implements INodeType { 'GET', ); } else { - qs.maxResults = this.getNodeParameter('limit', i) as number; + qs.maxResults = this.getNodeParameter('limit', i); responseData = await jiraSoftwareCloudApiRequest.call( this, `/api/2/issue/${issueKey}/changelog`, @@ -1107,7 +1107,7 @@ export class Jira implements INodeType { ); responseData = attachment; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } responseData = responseData.map((data: IDataObject) => ({ json: data })); @@ -1255,7 +1255,7 @@ export class Jira implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); body.maxResults = limit; responseData = await jiraSoftwareCloudApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Keap/Keap.node.ts b/packages/nodes-base/nodes/Keap/Keap.node.ts index 4eeee4e26b..c9b178a225 100644 --- a/packages/nodes-base/nodes/Keap/Keap.node.ts +++ b/packages/nodes-base/nodes/Keap/Keap.node.ts @@ -299,7 +299,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call(this, 'GET', '/companies', {}, qs); responseData = responseData.companies; } @@ -448,7 +448,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call(this, 'GET', '/contacts', {}, qs); responseData = responseData.contacts; } @@ -498,7 +498,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call(this, 'GET', '/notes', {}, qs); responseData = responseData.notes; } @@ -559,7 +559,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call( this, 'GET', @@ -629,7 +629,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call(this, 'GET', '/orders', {}, qs); responseData = responseData.orders; } @@ -674,7 +674,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call(this, 'GET', '/products', {}, qs); responseData = responseData.products; } @@ -716,7 +716,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call(this, 'GET', '/emails', {}, qs); responseData = responseData.emails; } @@ -810,7 +810,7 @@ export class Keap implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await keapApiRequest.call(this, 'GET', '/files', {}, qs); responseData = responseData.files; } diff --git a/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts b/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts index 6b41026e62..8a2d158631 100644 --- a/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Kitemaker/GenericFunctions.ts @@ -30,14 +30,14 @@ export async function kitemakerRequest( } export async function kitemakerRequestAllItems( - this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + this: IExecuteFunctions, body: { query: string; variables: { [key: string]: string } }, ) { const resource = this.getNodeParameter('resource', 0) as 'space' | 'user' | 'workItem'; const [group, items] = getGroupAndItems(resource); const returnAll = this.getNodeParameter('returnAll', 0, false) as boolean; - const limit = this.getNodeParameter('limit', 0, 0) as number; + const limit = this.getNodeParameter('limit', 0, 0); const returnData: IDataObject[] = []; let responseData; diff --git a/packages/nodes-base/nodes/KoBoToolbox/KoBoToolbox.node.ts b/packages/nodes-base/nodes/KoBoToolbox/KoBoToolbox.node.ts index f91a22b7e5..5e7fb81210 100644 --- a/packages/nodes-base/nodes/KoBoToolbox/KoBoToolbox.node.ts +++ b/packages/nodes-base/nodes/KoBoToolbox/KoBoToolbox.node.ts @@ -119,7 +119,7 @@ export class KoBoToolbox implements INodeType { responseData = await koBoToolboxApiRequest.call(this, { url: '/api/v2/assets/', qs: { - limit: this.getNodeParameter('limit', i, 1000) as number, + limit: this.getNodeParameter('limit', i, 1000), ...(formFilterOptions.filter && { q: formFilterOptions.filter }), ...(formQueryOptions?.sort?.value?.ordering && { ordering: @@ -148,7 +148,7 @@ export class KoBoToolbox implements INodeType { responseData = await koBoToolboxApiRequest.call(this, { url: `/api/v2/assets/${formId}/data/`, qs: { - limit: this.getNodeParameter('limit', i, 1000) as number, + limit: this.getNodeParameter('limit', i, 1000), ...(filterJson && { query: filterJson }), ...(submissionQueryOptions.sort && { sort: submissionQueryOptions.sort }), ...(submissionQueryOptions.fields && { @@ -277,7 +277,7 @@ export class KoBoToolbox implements INodeType { responseData = await koBoToolboxApiRequest.call(this, { url: `/api/v2/assets/${formId}/hooks/`, qs: { - limit: this.getNodeParameter('limit', i, 1000) as number, + limit: this.getNodeParameter('limit', i, 1000), }, scroll: this.getNodeParameter('returnAll', i) as boolean, }); diff --git a/packages/nodes-base/nodes/Lemlist/Lemlist.node.ts b/packages/nodes-base/nodes/Lemlist/Lemlist.node.ts index 55cec9ffa3..86999e5d69 100644 --- a/packages/nodes-base/nodes/Lemlist/Lemlist.node.ts +++ b/packages/nodes-base/nodes/Lemlist/Lemlist.node.ts @@ -135,7 +135,7 @@ export class Lemlist implements INodeType { responseData = await lemlistApiRequest.call(this, 'GET', '/activities', {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.slice(0, limit); } } @@ -280,7 +280,7 @@ export class Lemlist implements INodeType { responseData = await lemlistApiRequestAllItems.call(this, 'GET', '/unsubscribes'); } else { const qs = { - limit: this.getNodeParameter('limit', i) as number, + limit: this.getNodeParameter('limit', i), }; responseData = await lemlistApiRequest.call(this, 'GET', '/unsubscribes', {}, qs); } diff --git a/packages/nodes-base/nodes/Linear/Linear.node.ts b/packages/nodes-base/nodes/Linear/Linear.node.ts index 79475d07b9..4230073cf2 100644 --- a/packages/nodes-base/nodes/Linear/Linear.node.ts +++ b/packages/nodes-base/nodes/Linear/Linear.node.ts @@ -215,7 +215,7 @@ export class Linear implements INodeType { if (returnAll) { responseData = await linearApiRequestAllItems.call(this, 'data.issues', body); } else { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); body.variables.first = limit; responseData = await linearApiRequest.call(this, body); responseData = responseData.data.issues.nodes; diff --git a/packages/nodes-base/nodes/Magento/Magento2.node.ts b/packages/nodes-base/nodes/Magento/Magento2.node.ts index 7323dcd7bd..37f8e4d59b 100644 --- a/packages/nodes-base/nodes/Magento/Magento2.node.ts +++ b/packages/nodes-base/nodes/Magento/Magento2.node.ts @@ -446,7 +446,7 @@ export class Magento2 implements INodeType { qs as unknown as IDataObject, ); } else { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); qs.search_criteria!.page_size = limit; responseData = await magentoApiRequest.call( this, @@ -626,7 +626,7 @@ export class Magento2 implements INodeType { qs as unknown as IDataObject, ); } else { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); qs.search_criteria!.page_size = limit; responseData = await magentoApiRequest.call( this, @@ -748,7 +748,7 @@ export class Magento2 implements INodeType { qs as unknown as IDataObject, ); } else { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); qs.search_criteria!.page_size = limit; responseData = await magentoApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts index a9102bf0dd..dec570c550 100644 --- a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts @@ -1700,7 +1700,7 @@ export class Mailchimp implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', i) as number; + qs.count = this.getNodeParameter('limit', i); responseData = await mailchimpApiRequest.call( this, `/lists/${listId}/interest-categories/${categoryId}/interests`, @@ -1888,7 +1888,7 @@ export class Mailchimp implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', i) as number; + qs.count = this.getNodeParameter('limit', i); responseData = await mailchimpApiRequest.call( this, `/lists/${listId}/members`, @@ -2126,7 +2126,7 @@ export class Mailchimp implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', i) as number; + qs.count = this.getNodeParameter('limit', i); responseData = await mailchimpApiRequest.call(this, `/campaigns`, 'GET', {}, qs); responseData = responseData.campaigns; } diff --git a/packages/nodes-base/nodes/MailerLite/MailerLite.node.ts b/packages/nodes-base/nodes/MailerLite/MailerLite.node.ts index fe60a5efd8..50bf1a7622 100644 --- a/packages/nodes-base/nodes/MailerLite/MailerLite.node.ts +++ b/packages/nodes-base/nodes/MailerLite/MailerLite.node.ts @@ -141,7 +141,7 @@ export class MailerLite implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await mailerliteApiRequest.call(this, 'GET', `/subscribers`, {}, qs); } diff --git a/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts b/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts index 39963a4717..b66cf9ed18 100644 --- a/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Marketstack/GenericFunctions.ts @@ -43,7 +43,7 @@ export async function marketstackApiRequestAllItems( qs: IDataObject = {}, ) { const returnAll = this.getNodeParameter('returnAll', 0, false) as boolean; - const limit = this.getNodeParameter('limit', 0, 0) as number; + const limit = this.getNodeParameter('limit', 0, 0); let responseData; const returnData: IDataObject[] = []; diff --git a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts index 6aa2c6a68d..490e1ec044 100644 --- a/packages/nodes-base/nodes/Matrix/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Matrix/GenericFunctions.ts @@ -157,7 +157,7 @@ export async function handleMatrixCall( from = responseData.end; } while (responseData.chunk.length > 0); } else { - const limit = this.getNodeParameter('limit', index) as number; + const limit = this.getNodeParameter('limit', index); const qs: IDataObject = { dir: 'b', // GetfallbackText latest messages first - doesn't return anything if we use f without a previous token. limit, diff --git a/packages/nodes-base/nodes/Mattermost/v1/actions/channel/members/execute.ts b/packages/nodes-base/nodes/Mattermost/v1/actions/channel/members/execute.ts index 0f4a260b10..cd72b2089e 100644 --- a/packages/nodes-base/nodes/Mattermost/v1/actions/channel/members/execute.ts +++ b/packages/nodes-base/nodes/Mattermost/v1/actions/channel/members/execute.ts @@ -11,7 +11,7 @@ export async function members( const channelId = this.getNodeParameter('channelId', index) as string; const returnAll = this.getNodeParameter('returnAll', index) as boolean; const resolveData = this.getNodeParameter('resolveData', index) as boolean; - const limit = this.getNodeParameter('limit', index, 0) as number; + const limit = this.getNodeParameter('limit', index, 0); const body = {} as IDataObject; const qs = {} as IDataObject; @@ -19,7 +19,7 @@ export async function members( const endpoint = `channels/${channelId}/members`; if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', index) as number; + qs.per_page = this.getNodeParameter('limit', index); } let responseData; diff --git a/packages/nodes-base/nodes/Mattermost/v1/actions/reaction/getAll/execute.ts b/packages/nodes-base/nodes/Mattermost/v1/actions/reaction/getAll/execute.ts index d374cab0bb..4ad1a4ee06 100644 --- a/packages/nodes-base/nodes/Mattermost/v1/actions/reaction/getAll/execute.ts +++ b/packages/nodes-base/nodes/Mattermost/v1/actions/reaction/getAll/execute.ts @@ -9,7 +9,7 @@ export async function getAll( index: number, ): Promise { const postId = this.getNodeParameter('postId', index) as string; - const limit = this.getNodeParameter('limit', 0, 0) as number; + const limit = this.getNodeParameter('limit', 0, 0); const qs = {} as IDataObject; const requestMethod = 'GET'; diff --git a/packages/nodes-base/nodes/Mattermost/v1/actions/user/getAll/execute.ts b/packages/nodes-base/nodes/Mattermost/v1/actions/user/getAll/execute.ts index c55687d6d5..66ee8bf247 100644 --- a/packages/nodes-base/nodes/Mattermost/v1/actions/user/getAll/execute.ts +++ b/packages/nodes-base/nodes/Mattermost/v1/actions/user/getAll/execute.ts @@ -98,7 +98,7 @@ export async function getAll( } if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', index) as number; + qs.per_page = this.getNodeParameter('limit', index); } let responseData; diff --git a/packages/nodes-base/nodes/Mautic/Mautic.node.ts b/packages/nodes-base/nodes/Mautic/Mautic.node.ts index 83ed530197..271ada62ff 100644 --- a/packages/nodes-base/nodes/Mautic/Mautic.node.ts +++ b/packages/nodes-base/nodes/Mautic/Mautic.node.ts @@ -566,7 +566,7 @@ export class Mautic implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); qs.start = 0; responseData = await mauticApiRequest.call(this, 'GET', '/companies', {}, qs); if (responseData.errors) { @@ -853,7 +853,7 @@ export class Mautic implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); qs.start = 0; responseData = await mauticApiRequest.call(this, 'GET', '/contacts', {}, qs); if (responseData.errors) { diff --git a/packages/nodes-base/nodes/Medium/Medium.node.ts b/packages/nodes-base/nodes/Medium/Medium.node.ts index 6c2b0177ba..58cfbe3042 100644 --- a/packages/nodes-base/nodes/Medium/Medium.node.ts +++ b/packages/nodes-base/nodes/Medium/Medium.node.ts @@ -508,7 +508,7 @@ export class Medium implements INodeType { responseData = responseData.data; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/Microsoft/Dynamics/MicrosoftDynamicsCrm.node.ts b/packages/nodes-base/nodes/Microsoft/Dynamics/MicrosoftDynamicsCrm.node.ts index 79ebdd89f9..d118c92186 100644 --- a/packages/nodes-base/nodes/Microsoft/Dynamics/MicrosoftDynamicsCrm.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Dynamics/MicrosoftDynamicsCrm.node.ts @@ -236,7 +236,7 @@ export class MicrosoftDynamicsCrm implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', 0) as number; + qs['$top'] = this.getNodeParameter('limit', 0); responseData = await microsoftApiRequest.call(this, 'GET', `/accounts`, {}, qs); responseData = responseData.value; } diff --git a/packages/nodes-base/nodes/Microsoft/Excel/MicrosoftExcel.node.ts b/packages/nodes-base/nodes/Microsoft/Excel/MicrosoftExcel.node.ts index 47cce50030..8590c159f8 100644 --- a/packages/nodes-base/nodes/Microsoft/Excel/MicrosoftExcel.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Excel/MicrosoftExcel.node.ts @@ -278,7 +278,7 @@ export class MicrosoftExcel implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', @@ -341,7 +341,7 @@ export class MicrosoftExcel implements INodeType { ); } else { const rowsQs = { ...qs }; - rowsQs['$top'] = this.getNodeParameter('limit', i) as number; + rowsQs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', @@ -534,7 +534,7 @@ export class MicrosoftExcel implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', @@ -596,7 +596,7 @@ export class MicrosoftExcel implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Microsoft/Outlook/MicrosoftOutlook.node.ts b/packages/nodes-base/nodes/Microsoft/Outlook/MicrosoftOutlook.node.ts index 67dbb35ef1..9a92083671 100644 --- a/packages/nodes-base/nodes/Microsoft/Outlook/MicrosoftOutlook.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Outlook/MicrosoftOutlook.node.ts @@ -501,7 +501,7 @@ export class MicrosoftOutlook implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call(this, 'GET', endpoint, undefined, qs); responseData = responseData.value; } @@ -862,7 +862,7 @@ export class MicrosoftOutlook implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call(this, 'GET', endpoint, undefined, qs); responseData = responseData.value; } @@ -990,7 +990,7 @@ export class MicrosoftOutlook implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call(this, 'GET', '/mailFolders', {}, qs); responseData = responseData.value; } @@ -1029,7 +1029,7 @@ export class MicrosoftOutlook implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', @@ -1104,7 +1104,7 @@ export class MicrosoftOutlook implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call(this, 'GET', endpoint, undefined, qs); responseData = responseData.value; } diff --git a/packages/nodes-base/nodes/Microsoft/Teams/MicrosoftTeams.node.ts b/packages/nodes-base/nodes/Microsoft/Teams/MicrosoftTeams.node.ts index 98d9497ca4..2c6f348054 100644 --- a/packages/nodes-base/nodes/Microsoft/Teams/MicrosoftTeams.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Teams/MicrosoftTeams.node.ts @@ -322,7 +322,7 @@ export class MicrosoftTeams implements INodeType { `/v1.0/teams/${teamId}/channels`, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await microsoftApiRequestAllItems.call( this, 'value', @@ -401,7 +401,7 @@ export class MicrosoftTeams implements INodeType { `/beta/teams/${teamId}/channels/${channelId}/messages`, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await microsoftApiRequestAllItems.call( this, 'value', @@ -454,7 +454,7 @@ export class MicrosoftTeams implements INodeType { `/v1.0/chats/${chatId}/messages`, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await microsoftApiRequestAllItems.call( this, 'value', @@ -545,7 +545,7 @@ export class MicrosoftTeams implements INodeType { `/v1.0/users/${memberId}/planner/tasks`, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await microsoftApiRequestAllItems.call( this, 'value', @@ -566,7 +566,7 @@ export class MicrosoftTeams implements INodeType { `/v1.0/planner/plans/${planId}/tasks`, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await microsoftApiRequestAllItems.call( this, 'value', diff --git a/packages/nodes-base/nodes/Microsoft/ToDo/MicrosoftToDo.node.ts b/packages/nodes-base/nodes/Microsoft/ToDo/MicrosoftToDo.node.ts index 31f69199ea..974074c7b4 100644 --- a/packages/nodes-base/nodes/Microsoft/ToDo/MicrosoftToDo.node.ts +++ b/packages/nodes-base/nodes/Microsoft/ToDo/MicrosoftToDo.node.ts @@ -164,7 +164,7 @@ export class MicrosoftToDo implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', @@ -272,7 +272,7 @@ export class MicrosoftToDo implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', @@ -364,7 +364,7 @@ export class MicrosoftToDo implements INodeType { qs, ); } else { - qs['$top'] = this.getNodeParameter('limit', i) as number; + qs['$top'] = this.getNodeParameter('limit', i); responseData = await microsoftApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Misp/GenericFunctions.ts b/packages/nodes-base/nodes/Misp/GenericFunctions.ts index 33a51bbcda..0f5439d70d 100644 --- a/packages/nodes-base/nodes/Misp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Misp/GenericFunctions.ts @@ -72,7 +72,7 @@ export async function mispApiRequestAllItems(this: IExecuteFunctions, endpoint: const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); return responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Misp/Misp.node.ts b/packages/nodes-base/nodes/Misp/Misp.node.ts index f919ecd7ed..dd5b814fc1 100644 --- a/packages/nodes-base/nodes/Misp/Misp.node.ts +++ b/packages/nodes-base/nodes/Misp/Misp.node.ts @@ -603,7 +603,7 @@ export class Misp implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.Tag.slice(0, limit); } } else if (operation === 'update') { @@ -720,7 +720,7 @@ export class Misp implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.Warninglists.slice(0, limit).map((i) => i.Warninglist); } else { responseData = responseData.Warninglists.map((i) => i.Warninglist); diff --git a/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts b/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts index ba719daa47..87aa22ff20 100644 --- a/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts +++ b/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts @@ -326,7 +326,7 @@ export class MondayCom implements INodeType { if (returnAll === true) { responseData = await mondayComApiRequestAllItems.call(this, 'data.boards', body); } else { - body.variables.limit = this.getNodeParameter('limit', i) as number; + body.variables.limit = this.getNodeParameter('limit', i); responseData = await mondayComApiRequest.call(this, body); responseData = responseData.data.boards; } @@ -657,7 +657,7 @@ export class MondayCom implements INodeType { body, ); } else { - body.variables.limit = this.getNodeParameter('limit', i) as number; + body.variables.limit = this.getNodeParameter('limit', i); responseData = await mondayComApiRequest.call(this, body); responseData = responseData.data.boards[0].groups[0].items; } @@ -702,7 +702,7 @@ export class MondayCom implements INodeType { body, ); } else { - body.variables.limit = this.getNodeParameter('limit', i) as number; + body.variables.limit = this.getNodeParameter('limit', i); responseData = await mondayComApiRequest.call(this, body); responseData = responseData.data.items_by_column_values; } diff --git a/packages/nodes-base/nodes/N8nTrainingCustomerDatastore/N8nTrainingCustomerDatastore.node.ts b/packages/nodes-base/nodes/N8nTrainingCustomerDatastore/N8nTrainingCustomerDatastore.node.ts index b64dbcd678..54b022b345 100644 --- a/packages/nodes-base/nodes/N8nTrainingCustomerDatastore/N8nTrainingCustomerDatastore.node.ts +++ b/packages/nodes-base/nodes/N8nTrainingCustomerDatastore/N8nTrainingCustomerDatastore.node.ts @@ -127,7 +127,7 @@ export class N8nTrainingCustomerDatastore implements INodeType { if (returnAll === true) { responseData = data; } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = data.slice(0, limit); } } diff --git a/packages/nodes-base/nodes/Nasa/Nasa.node.ts b/packages/nodes-base/nodes/Nasa/Nasa.node.ts index dd71ebdd4d..367de1527d 100644 --- a/packages/nodes-base/nodes/Nasa/Nasa.node.ts +++ b/packages/nodes-base/nodes/Nasa/Nasa.node.ts @@ -917,7 +917,7 @@ export class Nasa implements INodeType { returnAll = this.getNodeParameter('returnAll', 0); if (returnAll === false) { - qs.size = this.getNodeParameter('limit', 0) as number; + qs.size = this.getNodeParameter('limit', 0); } propertyName = 'near_earth_objects'; diff --git a/packages/nodes-base/nodes/Netlify/Netlify.node.ts b/packages/nodes-base/nodes/Netlify/Netlify.node.ts index 5ce1d3e625..ae8f10e4c9 100644 --- a/packages/nodes-base/nodes/Netlify/Netlify.node.ts +++ b/packages/nodes-base/nodes/Netlify/Netlify.node.ts @@ -143,7 +143,7 @@ export class Netlify implements INodeType { `/sites/${siteId}/deploys`, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await netlifyApiRequest.call( this, 'GET', @@ -176,7 +176,7 @@ export class Netlify implements INodeType { { filter: 'all' }, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await netlifyApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts b/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts index 032e5a1dbb..9c75e4b53e 100644 --- a/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts +++ b/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts @@ -1059,7 +1059,7 @@ export class NextCloud implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); qs = this.getNodeParameter('options', i) as IDataObject; if (!returnAll) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } endpoint = `ocs/v1.php/cloud/users`; diff --git a/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts b/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts index ce105adf38..d72f6c6ad0 100644 --- a/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts +++ b/packages/nodes-base/nodes/NocoDB/NocoDB.node.ts @@ -378,60 +378,70 @@ export class NocoDB implements INodeType { const data = []; const downloadAttachments = this.getNodeParameter('downloadAttachments', 0) as boolean; try { - for (let i = 0; i < items.length; i++) { - requestMethod = 'GET'; + for (let i = 0; i < items.length; i++) { + requestMethod = 'GET'; - if (version === 1) { - endPoint = `/nc/${projectId}/api/v1/${table}`; - } else if (version === 2) { - endPoint = `/api/v1/db/data/noco/${projectId}/${table}`; - } - - returnAll = this.getNodeParameter('returnAll', 0); - qs = this.getNodeParameter('options', i, {}) as IDataObject; - - if (qs.sort) { - const properties = (qs.sort as IDataObject).property as Array<{ field: string, direction: string }>; - qs.sort = properties.map(prop => `${prop.direction === 'asc' ? '' : '-'}${prop.field}`).join(','); - } - - if (qs.fields) { - qs.fields = (qs.fields as IDataObject[]).join(','); - } - - if (returnAll === true) { - responseData = await apiRequestAllItems.call(this, requestMethod, endPoint, {}, qs); - } else { - qs.limit = this.getNodeParameter('limit', 0) as number; - responseData = await apiRequest.call(this, requestMethod, endPoint, {}, qs); - if (version === 2) { - responseData = responseData.list; - } - } - - const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray(responseData), - { itemData: { item: i } }, - ); - returnData.push(...executionData); - - if (downloadAttachments === true) { - const downloadFieldNames = (this.getNodeParameter('downloadFieldNames', 0) as string).split(','); - const response = await downloadRecordAttachments.call(this, responseData, downloadFieldNames); - data.push(...response); - } + if (version === 1) { + endPoint = `/nc/${projectId}/api/v1/${table}`; + } else if (version === 2) { + endPoint = `/api/v1/db/data/noco/${projectId}/${table}`; } - if (downloadAttachments) { - return [data]; + returnAll = this.getNodeParameter('returnAll', 0) as boolean; + qs = this.getNodeParameter('options', i, {}) as IDataObject; + + if (qs.sort) { + const properties = (qs.sort as IDataObject).property as Array<{ + field: string; + direction: string; + }>; + qs.sort = properties + .map((prop) => `${prop.direction === 'asc' ? '' : '-'}${prop.field}`) + .join(','); } - } catch (error) { - if (this.continueOnFail()) { - returnData.push({ json:{ error: error.toString() } }); + if (qs.fields) { + qs.fields = (qs.fields as IDataObject[]).join(','); + } + + if (returnAll === true) { + responseData = await apiRequestAllItems.call(this, requestMethod, endPoint, {}, qs); } else { - throw error; + qs.limit = this.getNodeParameter('limit', 0); + responseData = await apiRequest.call(this, requestMethod, endPoint, {}, qs); + if (version === 2) { + responseData = responseData.list; + } } + + const executionData = this.helpers.constructExecutionMetaData( + this.helpers.returnJsonArray(responseData), + { itemData: { item: i } }, + ); + returnData.push(...executionData); + + if (downloadAttachments === true) { + const downloadFieldNames = ( + this.getNodeParameter('downloadFieldNames', 0) as string + ).split(','); + const response = await downloadRecordAttachments.call( + this, + responseData, + downloadFieldNames, + ); + data.push(...response); + } + } + + if (downloadAttachments) { + return [data]; + } + } catch (error) { + if (this.continueOnFail()) { + returnData.push({ json: { error: error.toString() } }); + } else { + throw error; + } } return this.prepareOutputData(returnData as INodeExecutionData[]); @@ -442,66 +452,75 @@ export class NocoDB implements INodeType { const newItems: INodeExecutionData[] = []; for (let i = 0; i < items.length; i++) { - try { - const id = this.getNodeParameter('id', i) as string; + try { + const id = this.getNodeParameter('id', i) as string; - if (version === 1) { - endPoint = `/nc/${projectId}/api/v1/${table}/${id}`; - } else if (version === 2) { - endPoint = `/api/v1/db/data/noco/${projectId}/${table}/${id}`; - } - - responseData = await apiRequest.call(this, requestMethod, endPoint, {}, qs); - - if (version === 2 ) { - if (Object.keys(responseData).length === 0) { - // Get did fail - const errorMessage = `The row with the ID "${id}" could not be queried. It probably doesn't exist.`; - if (this.continueOnFail()) { - newItems.push({ json: {error: errorMessage }}); - continue; - } - throw new NodeApiError(this.getNode(), { message: errorMessage }, { message: errorMessage, itemIndex: i }); - } - } - - const downloadAttachments = this.getNodeParameter('downloadAttachments', i) as boolean; - - if (downloadAttachments === true) { - const downloadFieldNames = (this.getNodeParameter('downloadFieldNames', i) as string).split(','); - const data = await downloadRecordAttachments.call(this, [responseData], downloadFieldNames); - const newItem = { - binary: data[0].binary, - json: {}, - }; - - const executionData = this.helpers.constructExecutionMetaData( - [newItem] as INodeExecutionData[], - { itemData: { item: i } }, - ); - - newItems.push(...executionData); - } else { - const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray(responseData), - { itemData: { item: i } }, - ); - - newItems.push(...executionData); - } - - } catch (error) { - if (this.continueOnFail()) { - const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({error: error.toString()}), - { itemData: { item: i } }, - ); - - newItems.push(...executionData); - continue; - } - throw new NodeApiError(this.getNode(), error, {itemIndex: i}); + if (version === 1) { + endPoint = `/nc/${projectId}/api/v1/${table}/${id}`; + } else if (version === 2) { + endPoint = `/api/v1/db/data/noco/${projectId}/${table}/${id}`; } + + responseData = await apiRequest.call(this, requestMethod, endPoint, {}, qs); + + if (version === 2) { + if (Object.keys(responseData).length === 0) { + // Get did fail + const errorMessage = `The row with the ID "${id}" could not be queried. It probably doesn't exist.`; + if (this.continueOnFail()) { + newItems.push({ json: { error: errorMessage } }); + continue; + } + throw new NodeApiError( + this.getNode(), + { message: errorMessage }, + { message: errorMessage, itemIndex: i }, + ); + } + } + + const downloadAttachments = this.getNodeParameter('downloadAttachments', i) as boolean; + + if (downloadAttachments === true) { + const downloadFieldNames = ( + this.getNodeParameter('downloadFieldNames', i) as string + ).split(','); + const data = await downloadRecordAttachments.call( + this, + [responseData], + downloadFieldNames, + ); + const newItem = { + binary: data[0].binary, + json: {}, + }; + + const executionData = this.helpers.constructExecutionMetaData( + [newItem] as INodeExecutionData[], + { itemData: { item: i } }, + ); + + newItems.push(...executionData); + } else { + const executionData = this.helpers.constructExecutionMetaData( + this.helpers.returnJsonArray(responseData), + { itemData: { item: i } }, + ); + + newItems.push(...executionData); + } + } catch (error) { + if (this.continueOnFail()) { + const executionData = this.helpers.constructExecutionMetaData( + this.helpers.returnJsonArray({ error: error.toString() }), + { itemData: { item: i } }, + ); + + newItems.push(...executionData); + continue; + } + throw new NodeApiError(this.getNode(), error, { itemIndex: i }); + } } return this.prepareOutputData(newItems); } diff --git a/packages/nodes-base/nodes/Notion/v1/NotionV1.node.ts b/packages/nodes-base/nodes/Notion/v1/NotionV1.node.ts index 8efa2179a7..eb6421d9be 100644 --- a/packages/nodes-base/nodes/Notion/v1/NotionV1.node.ts +++ b/packages/nodes-base/nodes/Notion/v1/NotionV1.node.ts @@ -47,7 +47,9 @@ export class NotionV1 implements INodeType { loadOptions: { async getDatabaseProperties(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const databaseId = this.getCurrentNodeParameter('databaseId', { extractValue: true }) as string; + const databaseId = this.getCurrentNodeParameter('databaseId', { + extractValue: true, + }) as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); for (const key of Object.keys(properties)) { //remove parameters that cannot be set from the API. @@ -81,7 +83,9 @@ export class NotionV1 implements INodeType { }, async getFilterProperties(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const databaseId = this.getCurrentNodeParameter('databaseId', { extractValue: true }) as string; + const databaseId = this.getCurrentNodeParameter('databaseId', { + extractValue: true, + }) as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); for (const key of Object.keys(properties)) { returnData.push({ @@ -105,7 +109,9 @@ export class NotionV1 implements INodeType { }, async getPropertySelectValues(this: ILoadOptionsFunctions): Promise { const [name, type] = (this.getCurrentNodeParameter('&key') as string).split('|'); - const databaseId = this.getCurrentNodeParameter('databaseId', { extractValue: true }) as string; + const databaseId = this.getCurrentNodeParameter('databaseId', { + extractValue: true, + }) as string; const resource = this.getCurrentNodeParameter('resource') as string; const operation = this.getCurrentNodeParameter('operation') as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); @@ -142,7 +148,9 @@ export class NotionV1 implements INodeType { }, async getDatabaseIdFromPage(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const pageId = extractPageId(this.getCurrentNodeParameter('pageId', { extractValue: true }) as string); + const pageId = extractPageId( + this.getCurrentNodeParameter('pageId', { extractValue: true }) as string, + ); const { parent: { database_id: databaseId }, } = await notionApiRequest.call(this, 'GET', `/pages/${pageId}`); @@ -180,7 +188,9 @@ export class NotionV1 implements INodeType { async getDatabaseOptionsFromPage( this: ILoadOptionsFunctions, ): Promise { - const pageId = extractPageId(this.getCurrentNodeParameter('pageId', { extractValue: true }) as string); + const pageId = extractPageId( + this.getCurrentNodeParameter('pageId', { extractValue: true }) as string, + ); const [name, type] = (this.getCurrentNodeParameter('&key') as string).split('|'); const { parent: { database_id: databaseId }, @@ -228,7 +238,9 @@ export class NotionV1 implements INodeType { if (resource === 'block') { if (operation === 'append') { for (let i = 0; i < length; i++) { - const blockId = extractPageId(this.getNodeParameter('blockId', i, '', { extractValue: true }) as string); + const blockId = extractPageId( + this.getNodeParameter('blockId', i, '', { extractValue: true }) as string, + ); const blockValues = this.getNodeParameter('blockUi.blockValues', i, []) as IDataObject[]; extractDatabaseMentionRLC(blockValues); const body: IDataObject = { @@ -262,7 +274,7 @@ export class NotionV1 implements INodeType { {}, ); } else { - qs.page_size = this.getNodeParameter('limit', i) as number; + qs.page_size = this.getNodeParameter('limit', i); responseData = await notionApiRequest.call( this, 'GET', @@ -285,7 +297,9 @@ export class NotionV1 implements INodeType { if (resource === 'database') { if (operation === 'get') { for (let i = 0; i < length; i++) { - const databaseId = extractDatabaseId(this.getNodeParameter('databaseId', i, '', { extractValue: true }) as string); + const databaseId = extractDatabaseId( + this.getNodeParameter('databaseId', i, '', { extractValue: true }) as string, + ); responseData = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); const executionData = this.helpers.constructExecutionMetaData( @@ -311,7 +325,7 @@ export class NotionV1 implements INodeType { body, ); } else { - body['page_size'] = this.getNodeParameter('limit', i) as number; + body['page_size'] = this.getNodeParameter('limit', i); responseData = await notionApiRequest.call(this, 'POST', `/search`, body); responseData = responseData.results; } @@ -334,7 +348,9 @@ export class NotionV1 implements INodeType { parent: {}, properties: {}, }; - body.parent['database_id'] = this.getNodeParameter('databaseId', i, '', { extractValue: true }) as string; + body.parent['database_id'] = this.getNodeParameter('databaseId', i, '', { + extractValue: true, + }) as string; const properties = this.getNodeParameter( 'propertiesUi.propertyValues', i, @@ -402,7 +418,7 @@ export class NotionV1 implements INodeType { {}, ); } else { - body.page_size = this.getNodeParameter('limit', i) as number; + body.page_size = this.getNodeParameter('limit', i); responseData = await notionApiRequest.call( this, 'POST', @@ -426,7 +442,9 @@ export class NotionV1 implements INodeType { if (operation === 'update') { for (let i = 0; i < length; i++) { - const pageId = extractPageId(this.getNodeParameter('pageId', i, '', { extractValue: true }) as string); + const pageId = extractPageId( + this.getNodeParameter('pageId', i, '', { extractValue: true }) as string, + ); const simple = this.getNodeParameter('simple', i) as boolean; const properties = this.getNodeParameter( 'propertiesUi.propertyValues', @@ -473,7 +491,7 @@ export class NotionV1 implements INodeType { if (returnAll) { responseData = await notionApiRequestAllItems.call(this, 'results', 'GET', '/users'); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await notionApiRequestAllItems.call(this, 'results', 'GET', '/users'); responseData = responseData.splice(0, qs.limit); } @@ -496,7 +514,9 @@ export class NotionV1 implements INodeType { parent: {}, properties: {}, }; - body.parent['page_id'] = extractPageId(this.getNodeParameter('pageId', i, '', { extractValue: true }) as string); + body.parent['page_id'] = extractPageId( + this.getNodeParameter('pageId', i, '', { extractValue: true }) as string, + ); body.properties = formatTitle(this.getNodeParameter('title', i) as string); const blockValues = this.getNodeParameter('blockUi.blockValues', i, []) as IDataObject[]; extractDatabaseMentionRLC(blockValues); @@ -561,7 +581,7 @@ export class NotionV1 implements INodeType { body, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await notionApiRequestAllItems.call( this, 'results', diff --git a/packages/nodes-base/nodes/Notion/v2/NotionV2.node.ts b/packages/nodes-base/nodes/Notion/v2/NotionV2.node.ts index 62efd3ac0f..68ef0c89e9 100644 --- a/packages/nodes-base/nodes/Notion/v2/NotionV2.node.ts +++ b/packages/nodes-base/nodes/Notion/v2/NotionV2.node.ts @@ -51,7 +51,9 @@ export class NotionV2 implements INodeType { loadOptions: { async getDatabaseProperties(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const databaseId = this.getCurrentNodeParameter('databaseId', { extractValue: true }) as string; + const databaseId = this.getCurrentNodeParameter('databaseId', { + extractValue: true, + }) as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); for (const key of Object.keys(properties)) { //remove parameters that cannot be set from the API. @@ -84,7 +86,9 @@ export class NotionV2 implements INodeType { }, async getFilterProperties(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const databaseId = this.getCurrentNodeParameter('databaseId', { extractValue: true }) as string; + const databaseId = this.getCurrentNodeParameter('databaseId', { + extractValue: true, + }) as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); for (const key of Object.keys(properties)) { returnData.push({ @@ -108,7 +112,9 @@ export class NotionV2 implements INodeType { }, async getPropertySelectValues(this: ILoadOptionsFunctions): Promise { const [name, type] = (this.getCurrentNodeParameter('&key') as string).split('|'); - const databaseId = this.getCurrentNodeParameter('databaseId', { extractValue: true }) as string; + const databaseId = this.getCurrentNodeParameter('databaseId', { + extractValue: true, + }) as string; const resource = this.getCurrentNodeParameter('resource') as string; const operation = this.getCurrentNodeParameter('operation') as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); @@ -148,7 +154,9 @@ export class NotionV2 implements INodeType { }, async getDatabaseIdFromPage(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const pageId = extractPageId(this.getCurrentNodeParameter('pageId', { extractValue: true }) as string); + const pageId = extractPageId( + this.getCurrentNodeParameter('pageId', { extractValue: true }) as string, + ); const { parent: { database_id: databaseId }, } = await notionApiRequest.call(this, 'GET', `/pages/${pageId}`); @@ -186,7 +194,9 @@ export class NotionV2 implements INodeType { async getDatabaseOptionsFromPage( this: ILoadOptionsFunctions, ): Promise { - const pageId = extractPageId(this.getCurrentNodeParameter('pageId', { extractValue: true }) as string); + const pageId = extractPageId( + this.getCurrentNodeParameter('pageId', { extractValue: true }) as string, + ); const [name, type] = (this.getCurrentNodeParameter('&key') as string).split('|'); const { parent: { database_id: databaseId }, @@ -235,7 +245,9 @@ export class NotionV2 implements INodeType { if (resource === 'block') { if (operation === 'append') { for (let i = 0; i < length; i++) { - const blockId = extractPageId(this.getNodeParameter('blockId', i, '', { extractValue: true }) as string); + const blockId = extractPageId( + this.getNodeParameter('blockId', i, '', { extractValue: true }) as string, + ); const blockValues = this.getNodeParameter('blockUi.blockValues', i, []) as IDataObject[]; extractDatabaseMentionRLC(blockValues); const body: IDataObject = { @@ -270,7 +282,7 @@ export class NotionV2 implements INodeType { {}, ); } else { - qs.page_size = this.getNodeParameter('limit', i) as number; + qs.page_size = this.getNodeParameter('limit', i); responseData = await notionApiRequest.call( this, 'GET', @@ -300,7 +312,9 @@ export class NotionV2 implements INodeType { if (operation === 'get') { const simple = this.getNodeParameter('simple', 0) as boolean; for (let i = 0; i < length; i++) { - const databaseId = extractDatabaseId(this.getNodeParameter('databaseId', i, '', { extractValue: true }) as string); + const databaseId = extractDatabaseId( + this.getNodeParameter('databaseId', i, '', { extractValue: true }) as string, + ); responseData = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); if (simple === true) { responseData = simplifyObjects(responseData, download)[0]; @@ -330,7 +344,7 @@ export class NotionV2 implements INodeType { body, ); } else { - body['page_size'] = this.getNodeParameter('limit', i) as number; + body['page_size'] = this.getNodeParameter('limit', i); responseData = await notionApiRequest.call(this, 'POST', `/search`, body); responseData = responseData.results; } @@ -375,7 +389,7 @@ export class NotionV2 implements INodeType { body, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await notionApiRequestAllItems.call( this, 'results', @@ -401,7 +415,9 @@ export class NotionV2 implements INodeType { if (resource === 'databasePage') { if (operation === 'create') { - const databaseId = this.getNodeParameter('databaseId', 0, '', { extractValue: true }) as string; + const databaseId = this.getNodeParameter('databaseId', 0, '', { + extractValue: true, + }) as string; const { properties } = await notionApiRequest.call(this, 'GET', `/databases/${databaseId}`); let titleKey = ''; for (const key of Object.keys(properties)) { @@ -428,7 +444,9 @@ export class NotionV2 implements INodeType { ], }; } - body.parent['database_id'] = this.getNodeParameter('databaseId', i, '', { extractValue: true }) as string; + body.parent['database_id'] = this.getNodeParameter('databaseId', i, '', { + extractValue: true, + }) as string; const properties = this.getNodeParameter( 'propertiesUi.propertyValues', i, @@ -458,7 +476,9 @@ export class NotionV2 implements INodeType { if (operation === 'get') { for (let i = 0; i < length; i++) { - const pageId = extractPageId(this.getNodeParameter('pageId', i, '', { extractValue: true }) as string); + const pageId = extractPageId( + this.getNodeParameter('pageId', i, '', { extractValue: true }) as string, + ); const simple = this.getNodeParameter('simple', i) as boolean; responseData = await notionApiRequest.call(this, 'GET', `/pages/${pageId}`); if (simple === true) { @@ -525,7 +545,7 @@ export class NotionV2 implements INodeType { {}, ); } else { - body.page_size = this.getNodeParameter('limit', i) as number; + body.page_size = this.getNodeParameter('limit', i); responseData = await notionApiRequest.call( this, 'POST', @@ -552,7 +572,9 @@ export class NotionV2 implements INodeType { if (operation === 'update') { for (let i = 0; i < length; i++) { - const pageId = extractPageId(this.getNodeParameter('pageId', i, '', { extractValue: true }) as string); + const pageId = extractPageId( + this.getNodeParameter('pageId', i, '', { extractValue: true }) as string, + ); const simple = this.getNodeParameter('simple', i) as boolean; const properties = this.getNodeParameter( 'propertiesUi.propertyValues', @@ -599,7 +621,7 @@ export class NotionV2 implements INodeType { if (returnAll) { responseData = await notionApiRequestAllItems.call(this, 'results', 'GET', '/users'); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await notionApiRequestAllItems.call(this, 'results', 'GET', '/users'); responseData = responseData.splice(0, qs.limit); } @@ -616,7 +638,9 @@ export class NotionV2 implements INodeType { if (resource === 'page') { if (operation === 'archive') { for (let i = 0; i < length; i++) { - const pageId = extractPageId(this.getNodeParameter('pageId', i, '', { extractValue: true }) as string); + const pageId = extractPageId( + this.getNodeParameter('pageId', i, '', { extractValue: true }) as string, + ); const simple = this.getNodeParameter('simple', i) as boolean; responseData = await notionApiRequest.call(this, 'PATCH', `/pages/${pageId}`, { archived: true, @@ -641,7 +665,9 @@ export class NotionV2 implements INodeType { parent: {}, properties: {}, }; - body.parent['page_id'] = extractPageId(this.getNodeParameter('pageId', i, '', { extractValue: true }) as string); + body.parent['page_id'] = extractPageId( + this.getNodeParameter('pageId', i, '', { extractValue: true }) as string, + ); body.properties = formatTitle(this.getNodeParameter('title', i) as string); const blockValues = this.getNodeParameter('blockUi.blockValues', i, []) as IDataObject[]; extractDatabaseMentionRLC(blockValues); @@ -687,7 +713,7 @@ export class NotionV2 implements INodeType { body, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await notionApiRequestAllItems.call( this, 'results', diff --git a/packages/nodes-base/nodes/Odoo/Odoo.node.ts b/packages/nodes-base/nodes/Odoo/Odoo.node.ts index 8d5fab7ebb..84a829e5f3 100644 --- a/packages/nodes-base/nodes/Odoo/Odoo.node.ts +++ b/packages/nodes-base/nodes/Odoo/Odoo.node.ts @@ -397,7 +397,7 @@ export class Odoo implements INodeType { fields, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await odooGetAll.call( this, db, @@ -507,7 +507,7 @@ export class Odoo implements INodeType { fields, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await odooGetAll.call( this, db, @@ -608,7 +608,7 @@ export class Odoo implements INodeType { fields, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await odooGetAll.call( this, db, @@ -713,7 +713,7 @@ export class Odoo implements INodeType { fields, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await odooGetAll.call( this, db, diff --git a/packages/nodes-base/nodes/Onfleet/Onfleet.ts b/packages/nodes-base/nodes/Onfleet/Onfleet.ts index 5dd8c63a88..03f768e962 100644 --- a/packages/nodes-base/nodes/Onfleet/Onfleet.ts +++ b/packages/nodes-base/nodes/Onfleet/Onfleet.ts @@ -1206,7 +1206,7 @@ export class Onfleet { } if (!returnAll) { - const limit = this.getNodeParameter('limit', index) as number; + const limit = this.getNodeParameter('limit', index); workers = workers.slice(0, limit); } @@ -1406,7 +1406,7 @@ export class Onfleet { const returnAll = this.getNodeParameter('returnAll', 0, false) as boolean; let teams = await onfleetApiRequest.call(this, 'GET', resource); if (!returnAll) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); teams = teams.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Orbit/Orbit.node.ts b/packages/nodes-base/nodes/Orbit/Orbit.node.ts index 5dd9e6e63a..f5e68803d6 100644 --- a/packages/nodes-base/nodes/Orbit/Orbit.node.ts +++ b/packages/nodes-base/nodes/Orbit/Orbit.node.ts @@ -173,7 +173,7 @@ export class Orbit implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as boolean; + qs.limit = this.getNodeParameter('limit', 0); responseData = await orbitApiRequestAllItems.call( this, 'data', @@ -301,7 +301,7 @@ export class Orbit implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as boolean; + qs.limit = this.getNodeParameter('limit', 0); responseData = await orbitApiRequestAllItems.call( this, 'data', @@ -428,7 +428,7 @@ export class Orbit implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as boolean; + qs.limit = this.getNodeParameter('limit', 0); responseData = await orbitApiRequestAllItems.call( this, 'data', @@ -498,7 +498,7 @@ export class Orbit implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as boolean; + qs.limit = this.getNodeParameter('limit', 0); responseData = await orbitApiRequestAllItems.call( this, 'data', diff --git a/packages/nodes-base/nodes/Oura/Oura.node.ts b/packages/nodes-base/nodes/Oura/Oura.node.ts index bc34c1f939..814e9f29f2 100644 --- a/packages/nodes-base/nodes/Oura/Oura.node.ts +++ b/packages/nodes-base/nodes/Oura/Oura.node.ts @@ -112,7 +112,7 @@ export class Oura implements INodeType { responseData = responseData.activity; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } } else if (operation === 'getReadiness') { @@ -124,7 +124,7 @@ export class Oura implements INodeType { responseData = responseData.readiness; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } } else if (operation === 'getSleep') { @@ -136,7 +136,7 @@ export class Oura implements INodeType { responseData = responseData.sleep; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/Paddle/Paddle.node.ts b/packages/nodes-base/nodes/Paddle/Paddle.node.ts index e2e4c53b5b..3d8671efa9 100644 --- a/packages/nodes-base/nodes/Paddle/Paddle.node.ts +++ b/packages/nodes-base/nodes/Paddle/Paddle.node.ts @@ -263,7 +263,7 @@ export class Paddle implements INodeType { if (returnAll) { responseData = responseData.response; } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.response.splice(0, limit); } } @@ -405,7 +405,7 @@ export class Paddle implements INodeType { if (returnAll) { responseData = responseData.response; } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.response.splice(0, limit); } } @@ -431,7 +431,7 @@ export class Paddle implements INodeType { if (returnAll) { responseData = responseData.response; } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.response.splice(0, limit); } } @@ -456,7 +456,7 @@ export class Paddle implements INodeType { if (returnAll) { responseData = responseData.response.products; } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.response.products.splice(0, limit); } } @@ -519,7 +519,7 @@ export class Paddle implements INodeType { body, ); } else { - body.results_per_page = this.getNodeParameter('limit', i) as number; + body.results_per_page = this.getNodeParameter('limit', i); responseData = await paddleApiRequest.call(this, endpoint, 'POST', body); responseData = responseData.response; } diff --git a/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts b/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts index 22d192dd96..25a94da311 100644 --- a/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts +++ b/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts @@ -302,7 +302,7 @@ export class PagerDuty implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await pagerDutyApiRequest.call(this, 'GET', '/incidents', {}, qs); responseData = responseData.incidents; } @@ -401,7 +401,7 @@ export class PagerDuty implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await pagerDutyApiRequest.call( this, 'GET', @@ -440,7 +440,7 @@ export class PagerDuty implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await pagerDutyApiRequest.call(this, 'GET', '/log_entries', {}, qs); responseData = responseData.log_entries; } diff --git a/packages/nodes-base/nodes/PayPal/PayPal.node.ts b/packages/nodes-base/nodes/PayPal/PayPal.node.ts index 35c8241d87..fa23f5e67b 100644 --- a/packages/nodes-base/nodes/PayPal/PayPal.node.ts +++ b/packages/nodes-base/nodes/PayPal/PayPal.node.ts @@ -201,7 +201,7 @@ export class PayPal implements INodeType { qs, ); } else { - qs.page_size = this.getNodeParameter('limit', i) as number; + qs.page_size = this.getNodeParameter('limit', i); responseData = await payPalApiRequest.call( this, `/payments/payouts/${payoutBatchId}`, diff --git a/packages/nodes-base/nodes/Phantombuster/Phantombuster.node.ts b/packages/nodes-base/nodes/Phantombuster/Phantombuster.node.ts index 4aaa6e19f9..5c5df5116b 100644 --- a/packages/nodes-base/nodes/Phantombuster/Phantombuster.node.ts +++ b/packages/nodes-base/nodes/Phantombuster/Phantombuster.node.ts @@ -176,7 +176,7 @@ export class Phantombuster implements INodeType { responseData = await phantombusterApiRequest.call(this, 'GET', '/agents/fetch-all'); if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts b/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts index bc118d22f3..1763b7e522 100644 --- a/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts +++ b/packages/nodes-base/nodes/PhilipsHue/PhilipsHue.node.ts @@ -160,7 +160,7 @@ export class PhilipsHue implements INodeType { responseData = Object.values(lights); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts index 3494e072b1..db5243b12d 100644 --- a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts +++ b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts @@ -4107,7 +4107,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; @@ -4195,7 +4195,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const filters = this.getNodeParameter('filters', i) as IDataObject; addAdditionalFields(qs, filters); @@ -4228,7 +4228,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); qs.exact_match = this.getNodeParameter('exactMatch', i) as boolean; if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; @@ -4266,7 +4266,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; @@ -4438,7 +4438,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; addAdditionalFields(qs, additionalFields); @@ -4537,7 +4537,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const filters = this.getNodeParameter('filters', i) as IDataObject; @@ -4628,7 +4628,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const filters = this.getNodeParameter('filters', i) as IDataObject; @@ -4669,7 +4669,7 @@ export class Pipedrive implements INodeType { qs.term = this.getNodeParameter('term', i) as string; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject & { @@ -4725,7 +4725,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; @@ -4749,7 +4749,7 @@ export class Pipedrive implements INodeType { qs.term = this.getNodeParameter('term', i) as string; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; @@ -4798,7 +4798,7 @@ export class Pipedrive implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } endpoint = `/products`; @@ -4890,7 +4890,7 @@ export class Pipedrive implements INodeType { if (resource === 'file' && operation === 'download') { items[i].json = { error: error.message }; } else { - returnData.push({json:{ error: error.message }}); + returnData.push({ json: { error: error.message } }); } continue; } diff --git a/packages/nodes-base/nodes/Pushbullet/Pushbullet.node.ts b/packages/nodes-base/nodes/Pushbullet/Pushbullet.node.ts index 2de287c9c4..e989bb7b31 100644 --- a/packages/nodes-base/nodes/Pushbullet/Pushbullet.node.ts +++ b/packages/nodes-base/nodes/Pushbullet/Pushbullet.node.ts @@ -477,7 +477,7 @@ export class Pushbullet implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await pushbulletApiRequest.call(this, 'GET', '/pushes', {}, qs); diff --git a/packages/nodes-base/nodes/QuickBase/QuickBase.node.ts b/packages/nodes-base/nodes/QuickBase/QuickBase.node.ts index 663d8cbb9d..bd17a928c1 100644 --- a/packages/nodes-base/nodes/QuickBase/QuickBase.node.ts +++ b/packages/nodes-base/nodes/QuickBase/QuickBase.node.ts @@ -142,7 +142,7 @@ export class QuickBase implements INodeType { responseData = await quickbaseApiRequest.call(this, 'GET', '/fields', {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } @@ -358,7 +358,7 @@ export class QuickBase implements INodeType { qs, ); } else { - body.options = { top: this.getNodeParameter('limit', i) as number }; + body.options = { top: this.getNodeParameter('limit', i) }; responseData = await quickbaseApiRequest.call(this, 'POST', '/records/query', body, qs); @@ -575,7 +575,7 @@ export class QuickBase implements INodeType { qs, ); } else { - qs.top = this.getNodeParameter('limit', i) as number; + qs.top = this.getNodeParameter('limit', i); responseData = await quickbaseApiRequest.call( this, diff --git a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts index 1ac835b915..70d855f487 100644 --- a/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts +++ b/packages/nodes-base/nodes/QuickBooks/GenericFunctions.ts @@ -174,7 +174,7 @@ export async function handleListing( if (returnAll) { return await quickBooksApiRequestAllItems.call(this, 'GET', endpoint, qs, {}, resource); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.query += ` MAXRESULTS ${limit}`; responseData = await quickBooksApiRequest.call(this, 'GET', endpoint, qs, {}); responseData = responseData.QueryResponse[capitalCase(resource)]; diff --git a/packages/nodes-base/nodes/Raindrop/Raindrop.node.ts b/packages/nodes-base/nodes/Raindrop/Raindrop.node.ts index 4e2d55aed5..b7463d1971 100644 --- a/packages/nodes-base/nodes/Raindrop/Raindrop.node.ts +++ b/packages/nodes-base/nodes/Raindrop/Raindrop.node.ts @@ -173,7 +173,7 @@ export class Raindrop implements INodeType { responseData = responseData.items; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.slice(0, limit); } } else if (operation === 'update') { @@ -283,7 +283,7 @@ export class Raindrop implements INodeType { responseData = responseData.items; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.slice(0, limit); } } else if (operation === 'update') { @@ -427,7 +427,7 @@ export class Raindrop implements INodeType { responseData = responseData.items; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.slice(0, limit); } } diff --git a/packages/nodes-base/nodes/Reddit/Reddit.node.ts b/packages/nodes-base/nodes/Reddit/Reddit.node.ts index 9708eb9f46..6088f60365 100644 --- a/packages/nodes-base/nodes/Reddit/Reddit.node.ts +++ b/packages/nodes-base/nodes/Reddit/Reddit.node.ts @@ -208,7 +208,7 @@ export class Reddit implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } } @@ -373,7 +373,7 @@ export class Reddit implements INodeType { responseData = await redditApiRequest.call(this, 'GET', endpoint, {}); responseData = responseData.subreddit_names.map((name: string) => ({ name })); if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } } else if (filters.keyword) { @@ -386,7 +386,7 @@ export class Reddit implements INodeType { const returnAll = this.getNodeParameter('returnAll', 0); if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.subreddits.splice(0, limit); } } else { diff --git a/packages/nodes-base/nodes/S3/S3.node.ts b/packages/nodes-base/nodes/S3/S3.node.ts index 4997726e03..0a6fdde093 100644 --- a/packages/nodes-base/nodes/S3/S3.node.ts +++ b/packages/nodes-base/nodes/S3/S3.node.ts @@ -174,7 +174,7 @@ export class S3 implements INodeType { '', ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await s3ApiRequestSOAPAllItems.call( this, 'ListAllMyBucketsResult.Buckets.Bucket', @@ -241,7 +241,7 @@ export class S3 implements INodeType { region, ); } else { - qs['max-keys'] = this.getNodeParameter('limit', 0) as number; + qs['max-keys'] = this.getNodeParameter('limit', 0); responseData = await s3ApiRequestSOAP.call( this, bucketName, @@ -293,9 +293,19 @@ export class S3 implements INodeType { const region = responseData.LocationConstraint._; - responseData = await s3ApiRequestSOAP.call(this, bucketName, 'PUT', path, '', qs, headers, {}, region); + responseData = await s3ApiRequestSOAP.call( + this, + bucketName, + 'PUT', + path, + '', + qs, + headers, + {}, + region, + ); const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({success: true}), + this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } }, ); returnData.push(...executionData); @@ -422,7 +432,7 @@ export class S3 implements INodeType { region, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await s3ApiRequestSOAPAllItems.call( this, 'ListBucketResult.Contents', @@ -660,7 +670,7 @@ export class S3 implements INodeType { ); const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({success: true}), + this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } }, ); returnData.push(...executionData); @@ -704,7 +714,7 @@ export class S3 implements INodeType { region, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await s3ApiRequestSOAPAllItems.call( this, 'ListBucketResult.Contents', @@ -882,7 +892,7 @@ export class S3 implements INodeType { } const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({success: true}), + this.helpers.returnJsonArray({ success: true }), { itemData: { item: i } }, ); returnData.push(...executionData); @@ -895,7 +905,7 @@ export class S3 implements INodeType { items[i].json = { error: error.message }; } else { const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({error: error.message}), + this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } }, ); returnData.push(...executionData); diff --git a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts index 5ddcc63735..67dc66a11a 100644 --- a/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts +++ b/packages/nodes-base/nodes/Salesforce/Salesforce.node.ts @@ -1301,7 +1301,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'Lead', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -1647,7 +1647,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'Contact', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -1803,7 +1803,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, customObject, returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -2048,7 +2048,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'Opportunity', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -2338,7 +2338,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'Account', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -2553,7 +2553,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'Case', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -2816,7 +2816,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'Task', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -2948,7 +2948,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'Attachment', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -3003,7 +3003,7 @@ export class Salesforce implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.q = getQuery(options, 'User', returnAll, limit) as string; responseData = await salesforceApiRequestAllItems.call( this, @@ -3054,7 +3054,7 @@ export class Salesforce implements INodeType { responseData = await salesforceApiRequest.call(this, 'GET', '/actions/custom/flow'); responseData = responseData.actions; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/Salesmate/Salesmate.node.ts b/packages/nodes-base/nodes/Salesmate/Salesmate.node.ts index 321f1e63c6..1e153de998 100644 --- a/packages/nodes-base/nodes/Salesmate/Salesmate.node.ts +++ b/packages/nodes-base/nodes/Salesmate/Salesmate.node.ts @@ -363,7 +363,7 @@ export class Salesmate implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.rows = limit; responseData = await salesmateApiRequest.call( this, @@ -557,7 +557,7 @@ export class Salesmate implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.rows = limit; responseData = await salesmateApiRequest.call( this, @@ -766,7 +766,7 @@ export class Salesmate implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.rows = limit; responseData = await salesmateApiRequest.call( this, diff --git a/packages/nodes-base/nodes/SeaTable/SeaTable.node.ts b/packages/nodes-base/nodes/SeaTable/SeaTable.node.ts index 6e49043317..d3a2c0d9a4 100644 --- a/packages/nodes-base/nodes/SeaTable/SeaTable.node.ts +++ b/packages/nodes-base/nodes/SeaTable/SeaTable.node.ts @@ -309,7 +309,7 @@ export class SeaTable implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await seaTableApiRequest.call(this, ctx, 'GET', endpoint, body, qs); responseData = responseData.rows; } diff --git a/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts b/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts index 686b918e3d..f19c7cee81 100644 --- a/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts +++ b/packages/nodes-base/nodes/SecurityScorecard/SecurityScorecard.node.ts @@ -160,7 +160,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } @@ -206,7 +206,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', 0) as boolean; + const limit = this.getNodeParameter('limit', 0); responseData = responseData.splice(0, limit); } @@ -297,7 +297,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } returnData.push.apply(returnData, responseData as IDataObject[]); @@ -343,7 +343,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } @@ -377,7 +377,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } @@ -415,7 +415,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } @@ -446,7 +446,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } @@ -482,7 +482,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } @@ -506,7 +506,7 @@ export class SecurityScorecard implements INodeType { responseData = responseData.entries; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } diff --git a/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts b/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts index 66c965beab..31325112a3 100644 --- a/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts +++ b/packages/nodes-base/nodes/SendGrid/SendGrid.node.ts @@ -164,7 +164,7 @@ export class SendGrid implements INodeType { qs, ); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } const executionData = this.helpers.constructExecutionMetaData( @@ -337,8 +337,8 @@ export class SendGrid implements INodeType { } catch (error) { if (this.continueOnFail()) { const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({error: error.message}), - { itemData: {item: i} }, + this.helpers.returnJsonArray({ error: error.message }), + { itemData: { item: i } }, ); returnData.push(...executionData); continue; @@ -362,7 +362,7 @@ export class SendGrid implements INodeType { qs, ); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } @@ -374,8 +374,8 @@ export class SendGrid implements INodeType { } catch (error) { if (this.continueOnFail()) { const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({error: error.message}), - { itemData: {item: i} }, + this.helpers.returnJsonArray({ error: error.message }), + { itemData: { item: i } }, ); returnData.push(...executionData); continue; @@ -399,14 +399,14 @@ export class SendGrid implements INodeType { const executionData = this.helpers.constructExecutionMetaData( this.helpers.returnJsonArray(responseData), - { itemData: {item: i} }, + { itemData: { item: i } }, ); returnData.push(...executionData); } catch (error) { if (this.continueOnFail()) { const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({error: error.message}), - { itemData: {item: i} }, + this.helpers.returnJsonArray({ error: error.message }), + { itemData: { item: i } }, ); returnData.push(...executionData); continue; @@ -435,7 +435,7 @@ export class SendGrid implements INodeType { } catch (error) { if (this.continueOnFail()) { const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({error: error.message}), + this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } }, ); returnData.push(...executionData); @@ -496,7 +496,7 @@ export class SendGrid implements INodeType { } catch (error) { if (this.continueOnFail()) { const executionData = this.helpers.constructExecutionMetaData( - this.helpers.returnJsonArray({error: error.message}), + this.helpers.returnJsonArray({ error: error.message }), { itemData: { item: i } }, ); returnData.push(...executionData); diff --git a/packages/nodes-base/nodes/SentryIo/SentryIo.node.ts b/packages/nodes-base/nodes/SentryIo/SentryIo.node.ts index 72ef6a9614..135b44b649 100644 --- a/packages/nodes-base/nodes/SentryIo/SentryIo.node.ts +++ b/packages/nodes-base/nodes/SentryIo/SentryIo.node.ts @@ -302,7 +302,7 @@ export class SentryIo implements INodeType { const endpoint = `/api/0/projects/${organizationSlug}/${projectSlug}/events/`; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; } @@ -311,7 +311,7 @@ export class SentryIo implements INodeType { responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -346,14 +346,14 @@ export class SentryIo implements INodeType { } if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; } responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -418,7 +418,7 @@ export class SentryIo implements INodeType { } if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; } @@ -429,7 +429,7 @@ export class SentryIo implements INodeType { } if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -484,14 +484,14 @@ export class SentryIo implements INodeType { const endpoint = `/api/0/projects/`; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; } responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -531,14 +531,14 @@ export class SentryIo implements INodeType { } if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; } responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -680,14 +680,14 @@ export class SentryIo implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; } responseData = await sentryApiRequestAllItems.call(this, 'GET', endpoint, {}, qs); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } diff --git a/packages/nodes-base/nodes/ServiceNow/ServiceNow.node.ts b/packages/nodes-base/nodes/ServiceNow/ServiceNow.node.ts index b1795c48d9..026b906495 100644 --- a/packages/nodes-base/nodes/ServiceNow/ServiceNow.node.ts +++ b/packages/nodes-base/nodes/ServiceNow/ServiceNow.node.ts @@ -557,7 +557,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -657,7 +657,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -687,7 +687,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -717,7 +717,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -747,7 +747,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -816,7 +816,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -919,7 +919,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -1034,7 +1034,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -1081,7 +1081,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, @@ -1117,7 +1117,7 @@ export class ServiceNow implements INodeType { } if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.sysparm_limit = limit; const response = await serviceNowApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Shopify/Shopify.node.ts b/packages/nodes-base/nodes/Shopify/Shopify.node.ts index 6df80a54f8..bbad21b85a 100644 --- a/packages/nodes-base/nodes/Shopify/Shopify.node.ts +++ b/packages/nodes-base/nodes/Shopify/Shopify.node.ts @@ -316,7 +316,7 @@ export class Shopify implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await shopifyApiRequest.call(this, 'GET', '/orders.json', {}, qs); responseData = responseData.orders; } @@ -433,7 +433,7 @@ export class Shopify implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await shopifyApiRequest.call(this, 'GET', '/products.json', {}, qs); responseData = responseData.products; } diff --git a/packages/nodes-base/nodes/Slack/Slack.node.ts b/packages/nodes-base/nodes/Slack/Slack.node.ts index e842d48a9d..363cd3f6a8 100644 --- a/packages/nodes-base/nodes/Slack/Slack.node.ts +++ b/packages/nodes-base/nodes/Slack/Slack.node.ts @@ -381,7 +381,7 @@ export class Slack implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await slackApiRequest.call(this, 'GET', '/conversations.list', {}, qs); responseData = responseData.channels; } @@ -411,7 +411,7 @@ export class Slack implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await slackApiRequest.call( this, 'GET', @@ -469,7 +469,7 @@ export class Slack implements INodeType { ); responseData = responseData.map((member: string) => ({ member })); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await slackApiRequest.call( this, 'GET', @@ -561,7 +561,7 @@ export class Slack implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await slackApiRequest.call( this, 'GET', @@ -1063,7 +1063,7 @@ export class Slack implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await slackApiRequest.call(this, 'GET', '/stars.list', {}, qs); responseData = responseData.items; } @@ -1174,7 +1174,7 @@ export class Slack implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', i) as number; + qs.count = this.getNodeParameter('limit', i); responseData = await slackApiRequest.call(this, 'GET', '/files.list', {}, qs); responseData = responseData.files; } @@ -1207,7 +1207,7 @@ export class Slack implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await slackApiRequest.call(this, 'GET', '/users.list', {}, qs); responseData = responseData.members; } @@ -1289,7 +1289,7 @@ export class Slack implements INodeType { responseData = responseData.usergroups; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts index e760bc6889..fa96cb3926 100644 --- a/packages/nodes-base/nodes/Splunk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Splunk/GenericFunctions.ts @@ -216,9 +216,7 @@ function compactEntryContent(splunkObject: any): any { * Set count of entries to retrieve. */ export function setCount(this: IExecuteFunctions, qs: IDataObject) { - qs.count = this.getNodeParameter('returnAll', 0) - ? 0 - : (this.getNodeParameter('limit', 0) as number); + qs.count = this.getNodeParameter('returnAll', 0) ? 0 : this.getNodeParameter('limit', 0); } export function populate(source: IDataObject, destination: IDataObject) { diff --git a/packages/nodes-base/nodes/Spotify/Spotify.node.ts b/packages/nodes-base/nodes/Spotify/Spotify.node.ts index 31ffed0fb9..57333459f6 100644 --- a/packages/nodes-base/nodes/Spotify/Spotify.node.ts +++ b/packages/nodes-base/nodes/Spotify/Spotify.node.ts @@ -826,7 +826,7 @@ export class Spotify implements INodeType { propertyName = 'items'; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs = { limit, @@ -956,7 +956,7 @@ export class Spotify implements INodeType { propertyName = 'items'; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs = { limit, @@ -984,7 +984,7 @@ export class Spotify implements INodeType { }; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); responseData = responseData.albums.items; @@ -1007,7 +1007,7 @@ export class Spotify implements INodeType { propertyName = 'items'; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs = { limit, @@ -1060,7 +1060,7 @@ export class Spotify implements INodeType { }; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); responseData = responseData.artists.items; @@ -1107,7 +1107,7 @@ export class Spotify implements INodeType { propertyName = 'items'; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs = { limit, @@ -1151,7 +1151,7 @@ export class Spotify implements INodeType { propertyName = 'items'; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs = { limit, @@ -1192,7 +1192,7 @@ export class Spotify implements INodeType { }; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); responseData = responseData.playlists.items; @@ -1234,7 +1234,7 @@ export class Spotify implements INodeType { }; if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); responseData = responseData.tracks.items; @@ -1255,7 +1255,7 @@ export class Spotify implements INodeType { propertyName = 'items'; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs = { limit, @@ -1281,7 +1281,7 @@ export class Spotify implements INodeType { }; if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs = { type: 'artist', limit, diff --git a/packages/nodes-base/nodes/Stackby/Stackby.node.ts b/packages/nodes-base/nodes/Stackby/Stackby.node.ts index f7898d4101..44590ecba3 100644 --- a/packages/nodes-base/nodes/Stackby/Stackby.node.ts +++ b/packages/nodes-base/nodes/Stackby/Stackby.node.ts @@ -318,7 +318,7 @@ export class Stackby implements INodeType { qs, ); } else { - qs.maxrecord = this.getNodeParameter('limit', 0) as number; + qs.maxrecord = this.getNodeParameter('limit', 0); responseData = await apiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Storyblok/Storyblok.node.ts b/packages/nodes-base/nodes/Storyblok/Storyblok.node.ts index 0654458f3f..ba9becd12a 100644 --- a/packages/nodes-base/nodes/Storyblok/Storyblok.node.ts +++ b/packages/nodes-base/nodes/Storyblok/Storyblok.node.ts @@ -184,7 +184,7 @@ export class Storyblok implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; responseData = await storyblokApiRequest.call( this, @@ -294,7 +294,7 @@ export class Storyblok implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; responseData = await storyblokApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Strapi/Strapi.node.ts b/packages/nodes-base/nodes/Strapi/Strapi.node.ts index d3876e797e..b696c23a72 100644 --- a/packages/nodes-base/nodes/Strapi/Strapi.node.ts +++ b/packages/nodes-base/nodes/Strapi/Strapi.node.ts @@ -215,7 +215,7 @@ export class Strapi implements INodeType { headers, ); } else { - qs['pagination[pageSize]'] = this.getNodeParameter('limit', i) as number; + qs['pagination[pageSize]'] = this.getNodeParameter('limit', i); ({ data: responseData } = await strapiApiRequest.call( this, 'GET', @@ -258,7 +258,7 @@ export class Strapi implements INodeType { headers, ); } else { - qs._limit = this.getNodeParameter('limit', i) as number; + qs._limit = this.getNodeParameter('limit', i); responseData = await strapiApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Strava/Strava.node.ts b/packages/nodes-base/nodes/Strava/Strava.node.ts index d867967b4f..aa831eca3a 100644 --- a/packages/nodes-base/nodes/Strava/Strava.node.ts +++ b/packages/nodes-base/nodes/Strava/Strava.node.ts @@ -114,7 +114,7 @@ export class Strava implements INodeType { ); if (returnAll === false) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -146,7 +146,7 @@ export class Strava implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await stravaApiRequest.call(this, 'GET', `/activities`, {}, qs); } diff --git a/packages/nodes-base/nodes/Supabase/Supabase.node.ts b/packages/nodes-base/nodes/Supabase/Supabase.node.ts index 99f75aacc0..b58253b90a 100644 --- a/packages/nodes-base/nodes/Supabase/Supabase.node.ts +++ b/packages/nodes-base/nodes/Supabase/Supabase.node.ts @@ -273,7 +273,7 @@ export class Supabase implements INodeType { } if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); } let rows; diff --git a/packages/nodes-base/nodes/SyncroMSP/v1/actions/contact/getAll/execute.ts b/packages/nodes-base/nodes/SyncroMSP/v1/actions/contact/getAll/execute.ts index 22b61b43f7..8c92939052 100644 --- a/packages/nodes-base/nodes/SyncroMSP/v1/actions/contact/getAll/execute.ts +++ b/packages/nodes-base/nodes/SyncroMSP/v1/actions/contact/getAll/execute.ts @@ -20,7 +20,7 @@ export async function getAll( responseData = await apiRequestAllItems.call(this, requestMethod, endpoint, body, qs); return this.helpers.returnJsonArray(responseData); } else { - const limit = this.getNodeParameter('limit', index) as IDataObject; + const limit = this.getNodeParameter('limit', index); responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs); return this.helpers.returnJsonArray(responseData.contacts.splice(0, limit)); } diff --git a/packages/nodes-base/nodes/SyncroMSP/v1/actions/customer/getAll/execute.ts b/packages/nodes-base/nodes/SyncroMSP/v1/actions/customer/getAll/execute.ts index 7a883e7606..067c93da7a 100644 --- a/packages/nodes-base/nodes/SyncroMSP/v1/actions/customer/getAll/execute.ts +++ b/packages/nodes-base/nodes/SyncroMSP/v1/actions/customer/getAll/execute.ts @@ -27,7 +27,7 @@ export async function getAll( } if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', index) as number; + qs.per_page = this.getNodeParameter('limit', index); } let responseData; diff --git a/packages/nodes-base/nodes/SyncroMSP/v1/actions/rmm/getAll/execute.ts b/packages/nodes-base/nodes/SyncroMSP/v1/actions/rmm/getAll/execute.ts index 96e5eb249e..811a2828d5 100644 --- a/packages/nodes-base/nodes/SyncroMSP/v1/actions/rmm/getAll/execute.ts +++ b/packages/nodes-base/nodes/SyncroMSP/v1/actions/rmm/getAll/execute.ts @@ -25,7 +25,7 @@ export async function getAll( } if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', index) as number; + qs.per_page = this.getNodeParameter('limit', index); } let responseData; diff --git a/packages/nodes-base/nodes/SyncroMSP/v1/actions/ticket/getAll/execute.ts b/packages/nodes-base/nodes/SyncroMSP/v1/actions/ticket/getAll/execute.ts index 60cf089286..0d9eba021e 100644 --- a/packages/nodes-base/nodes/SyncroMSP/v1/actions/ticket/getAll/execute.ts +++ b/packages/nodes-base/nodes/SyncroMSP/v1/actions/ticket/getAll/execute.ts @@ -21,7 +21,7 @@ export async function getAll( } if (returnAll === false) { - qs.per_page = this.getNodeParameter('limit', index) as number; + qs.per_page = this.getNodeParameter('limit', index); } let responseData; diff --git a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts index 82067cbbe6..3867431d98 100644 --- a/packages/nodes-base/nodes/Taiga/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Taiga/GenericFunctions.ts @@ -150,7 +150,7 @@ export async function handleListing( if (returnAll) { return await taigaApiRequestAllItems.call(this, method, endpoint, body, qs); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await taigaApiRequestAllItems.call(this, method, endpoint, body, qs); return responseData.splice(0, qs.limit); } diff --git a/packages/nodes-base/nodes/Tapfiliate/Tapfiliate.node.ts b/packages/nodes-base/nodes/Tapfiliate/Tapfiliate.node.ts index ae0aeaf5b3..3012b3c01c 100644 --- a/packages/nodes-base/nodes/Tapfiliate/Tapfiliate.node.ts +++ b/packages/nodes-base/nodes/Tapfiliate/Tapfiliate.node.ts @@ -166,7 +166,7 @@ export class Tapfiliate implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await tapfiliateApiRequest.call(this, 'GET', `/affiliates/`, {}, qs); responseData = responseData.splice(0, limit); } @@ -283,7 +283,7 @@ export class Tapfiliate implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await tapfiliateApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/TheHive/TheHive.node.ts b/packages/nodes-base/nodes/TheHive/TheHive.node.ts index 50052cde94..b1e36f365e 100644 --- a/packages/nodes-base/nodes/TheHive/TheHive.node.ts +++ b/packages/nodes-base/nodes/TheHive/TheHive.node.ts @@ -572,7 +572,7 @@ export class TheHive implements INodeType { let limit = undefined; if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); } if (version === 'v1') { @@ -1012,7 +1012,7 @@ export class TheHive implements INodeType { let limit = undefined; if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); } if (version === 'v1') { @@ -1107,7 +1107,7 @@ export class TheHive implements INodeType { let limit = undefined; if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); } if (version === 'v1') { @@ -1381,7 +1381,7 @@ export class TheHive implements INodeType { let limit = undefined; if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); } if (version === 'v1') { @@ -1617,7 +1617,7 @@ export class TheHive implements INodeType { let limit = undefined; if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); } if (version === 'v1') { @@ -1700,7 +1700,7 @@ export class TheHive implements INodeType { let limit = undefined; if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); } if (version === 'v1') { @@ -1935,7 +1935,7 @@ export class TheHive implements INodeType { let limit = undefined; if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); } if (version === 'v1') { diff --git a/packages/nodes-base/nodes/TravisCi/TravisCi.node.ts b/packages/nodes-base/nodes/TravisCi/TravisCi.node.ts index fdba0ac8aa..b80ca67fb5 100644 --- a/packages/nodes-base/nodes/TravisCi/TravisCi.node.ts +++ b/packages/nodes-base/nodes/TravisCi/TravisCi.node.ts @@ -96,7 +96,7 @@ export class TravisCi implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await travisciApiRequest.call(this, 'GET', '/builds', {}, qs); responseData = responseData.builds; } diff --git a/packages/nodes-base/nodes/Trello/Trello.node.ts b/packages/nodes-base/nodes/Trello/Trello.node.ts index 06da9280b4..fc924de482 100644 --- a/packages/nodes-base/nodes/Trello/Trello.node.ts +++ b/packages/nodes-base/nodes/Trello/Trello.node.ts @@ -284,7 +284,7 @@ export class Trello implements INodeType { const id = this.getNodeParameter('id', i) as string; returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } endpoint = `boards/${id}/members`; @@ -500,7 +500,7 @@ export class Trello implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const id = this.getNodeParameter('id', i) as string; @@ -519,7 +519,7 @@ export class Trello implements INodeType { returnAll = this.getNodeParameter('returnAll', i); if (returnAll === false) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } const id = this.getNodeParameter('id', i) as string; diff --git a/packages/nodes-base/nodes/Twist/Twist.node.ts b/packages/nodes-base/nodes/Twist/Twist.node.ts index 13a5255b0c..cc90c28b6a 100644 --- a/packages/nodes-base/nodes/Twist/Twist.node.ts +++ b/packages/nodes-base/nodes/Twist/Twist.node.ts @@ -200,7 +200,7 @@ export class Twist implements INodeType { responseData = await twistApiRequest.call(this, 'GET', '/channels/get', {}, qs); if (!returnAll) { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } } @@ -326,7 +326,7 @@ export class Twist implements INodeType { Object.assign(qs, filters); if (!returnAll) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (qs.older_than_ts) { qs.older_than_ts = moment(qs.older_than_ts as string).unix(); @@ -722,7 +722,7 @@ export class Twist implements INodeType { Object.assign(qs, filters); if (!returnAll) { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); } if (qs.older_than_ts) { qs.older_than_ts = moment(qs.older_than_ts as string).unix(); diff --git a/packages/nodes-base/nodes/Twitter/Twitter.node.ts b/packages/nodes-base/nodes/Twitter/Twitter.node.ts index 175a85173e..02db2487b8 100644 --- a/packages/nodes-base/nodes/Twitter/Twitter.node.ts +++ b/packages/nodes-base/nodes/Twitter/Twitter.node.ts @@ -259,7 +259,7 @@ export class Twitter implements INodeType { qs, ); } else { - qs.count = this.getNodeParameter('limit', 0) as number; + qs.count = this.getNodeParameter('limit', 0); responseData = await twitterApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/UnleashedSoftware/UnleashedSoftware.node.ts b/packages/nodes-base/nodes/UnleashedSoftware/UnleashedSoftware.node.ts index 7bdd51386e..b64e19a94a 100644 --- a/packages/nodes-base/nodes/UnleashedSoftware/UnleashedSoftware.node.ts +++ b/packages/nodes-base/nodes/UnleashedSoftware/UnleashedSoftware.node.ts @@ -106,7 +106,7 @@ export class UnleashedSoftware implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.pageSize = limit; responseData = await unleashedApiRequest.call(this, 'GET', `/SalesOrders`, {}, qs, 1); responseData = responseData.Items; @@ -150,7 +150,7 @@ export class UnleashedSoftware implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.pageSize = limit; responseData = await unleashedApiRequest.call(this, 'GET', `/StockOnHand`, {}, qs, 1); responseData = responseData.Items; diff --git a/packages/nodes-base/nodes/UptimeRobot/UptimeRobot.node.ts b/packages/nodes-base/nodes/UptimeRobot/UptimeRobot.node.ts index 0b5efcbfdc..10d0687e86 100644 --- a/packages/nodes-base/nodes/UptimeRobot/UptimeRobot.node.ts +++ b/packages/nodes-base/nodes/UptimeRobot/UptimeRobot.node.ts @@ -190,7 +190,7 @@ export class UptimeRobot implements INodeType { } if (!returnAll) { - body.limit = this.getNodeParameter('limit', i) as number; + body.limit = this.getNodeParameter('limit', i); } responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getMonitors', body); @@ -257,7 +257,7 @@ export class UptimeRobot implements INodeType { }; if (!returnAll) { - body.limit = this.getNodeParameter('limit', i) as number; + body.limit = this.getNodeParameter('limit', i); } responseData = await uptimeRobotApiRequest.call( @@ -334,7 +334,7 @@ export class UptimeRobot implements INodeType { }; if (!returnAll) { - body.limit = this.getNodeParameter('limit', i) as number; + body.limit = this.getNodeParameter('limit', i); } responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getMWindows', body); @@ -398,7 +398,7 @@ export class UptimeRobot implements INodeType { }; if (!returnAll) { - body.limit = this.getNodeParameter('limit', i) as number; + body.limit = this.getNodeParameter('limit', i); } responseData = await uptimeRobotApiRequest.call(this, 'POST', '/getPSPs', body); diff --git a/packages/nodes-base/nodes/UrlScanIo/GenericFunctions.ts b/packages/nodes-base/nodes/UrlScanIo/GenericFunctions.ts index 3b32e78a52..f17ecb978d 100644 --- a/packages/nodes-base/nodes/UrlScanIo/GenericFunctions.ts +++ b/packages/nodes-base/nodes/UrlScanIo/GenericFunctions.ts @@ -41,7 +41,7 @@ export async function handleListing( qs.size = 100; const returnAll = this.getNodeParameter('returnAll', 0, false) as boolean; - const limit = this.getNodeParameter('limit', 0, 0) as number; + const limit = this.getNodeParameter('limit', 0, 0); do { responseData = await urlScanIoApiRequest.call(this, 'GET', endpoint, {}, qs); diff --git a/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenter.node.ts b/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenter.node.ts index a26072be3c..d3213b31e8 100644 --- a/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenter.node.ts +++ b/packages/nodes-base/nodes/Venafi/Datacenter/VenafiTlsProtectDatacenter.node.ts @@ -175,7 +175,7 @@ export class VenafiTlsProtectDatacenter implements INodeType { qs, ); } else { - qs.Limit = this.getNodeParameter('limit', i) as number; + qs.Limit = this.getNodeParameter('limit', i); responseData = await venafiApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts index 63e5c4bde7..c821eb6fc8 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/VenafiTlsProtectCloud.node.ts @@ -112,13 +112,15 @@ export class VenafiTlsProtectCloud implements INodeType { const returnData: INodePropertyOptions[] = []; const currentApplication: string = this.getCurrentNodeParameter('applicationId') as string; - const { certificateIssuingTemplateAliasIdMap } = await venafiApiRequest.call( + const { certificateIssuingTemplateAliasIdMap } = (await venafiApiRequest.call( this, 'GET', `/outagedetection/v1/applications/${currentApplication}`, - ) as { certificateIssuingTemplateAliasIdMap: { [key: string]: string } }; + )) as { certificateIssuingTemplateAliasIdMap: { [key: string]: string } }; - for (const [templateName, templateId] of Object.entries(certificateIssuingTemplateAliasIdMap)) { + for (const [templateName, templateId] of Object.entries( + certificateIssuingTemplateAliasIdMap, + )) { returnData.push({ name: templateName, value: templateId, @@ -277,7 +279,7 @@ export class VenafiTlsProtectCloud implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await venafiApiRequest.call( this, 'GET', @@ -420,7 +422,7 @@ export class VenafiTlsProtectCloud implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', i) as number; + qs.limit = this.getNodeParameter('limit', i); responseData = await venafiApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Webflow/Webflow.node.ts b/packages/nodes-base/nodes/Webflow/Webflow.node.ts index 91fa727c29..806df2594d 100644 --- a/packages/nodes-base/nodes/Webflow/Webflow.node.ts +++ b/packages/nodes-base/nodes/Webflow/Webflow.node.ts @@ -228,7 +228,7 @@ export class Webflow implements INodeType { qs, ); } else { - qs.limit = this.getNodeParameter('limit', 0) as number; + qs.limit = this.getNodeParameter('limit', 0); responseData = await webflowApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Wekan/Wekan.node.ts b/packages/nodes-base/nodes/Wekan/Wekan.node.ts index 797cc69582..e7ac53fa87 100644 --- a/packages/nodes-base/nodes/Wekan/Wekan.node.ts +++ b/packages/nodes-base/nodes/Wekan/Wekan.node.ts @@ -656,7 +656,7 @@ export class Wekan implements INodeType { let responseData = await apiRequest.call(this, requestMethod, endpoint, body, qs); if (returnAll === false) { - limit = this.getNodeParameter('limit', i) as number; + limit = this.getNodeParameter('limit', i); responseData = responseData.splice(0, limit); } diff --git a/packages/nodes-base/nodes/WooCommerce/WooCommerce.node.ts b/packages/nodes-base/nodes/WooCommerce/WooCommerce.node.ts index 71a8dcc061..ce6ea532a4 100644 --- a/packages/nodes-base/nodes/WooCommerce/WooCommerce.node.ts +++ b/packages/nodes-base/nodes/WooCommerce/WooCommerce.node.ts @@ -205,7 +205,7 @@ export class WooCommerce implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await woocommerceApiRequest.call(this, 'GET', '/customers', {}, qs); } } else if (operation === 'update') { @@ -366,7 +366,7 @@ export class WooCommerce implements INodeType { qs, ); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await woocommerceApiRequest.call(this, 'GET', '/products', {}, qs); } } @@ -565,7 +565,7 @@ export class WooCommerce implements INodeType { if (returnAll === true) { responseData = await woocommerceApiRequestAllItems.call(this, 'GET', '/orders', {}, qs); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await woocommerceApiRequest.call(this, 'GET', '/orders', {}, qs); } } diff --git a/packages/nodes-base/nodes/Wordpress/Wordpress.node.ts b/packages/nodes-base/nodes/Wordpress/Wordpress.node.ts index cbae44aea0..b1e07f5c66 100644 --- a/packages/nodes-base/nodes/Wordpress/Wordpress.node.ts +++ b/packages/nodes-base/nodes/Wordpress/Wordpress.node.ts @@ -285,7 +285,7 @@ export class Wordpress implements INodeType { if (returnAll === true) { responseData = await wordpressApiRequestAllItems.call(this, 'GET', '/posts', {}, qs); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await wordpressApiRequest.call(this, 'GET', '/posts', {}, qs); } } @@ -407,7 +407,7 @@ export class Wordpress implements INodeType { if (returnAll === true) { responseData = await wordpressApiRequestAllItems.call(this, 'GET', '/users', {}, qs); } else { - qs.per_page = this.getNodeParameter('limit', i) as number; + qs.per_page = this.getNodeParameter('limit', i); responseData = await wordpressApiRequest.call(this, 'GET', '/users', {}, qs); } } diff --git a/packages/nodes-base/nodes/Xero/Xero.node.ts b/packages/nodes-base/nodes/Xero/Xero.node.ts index ce7dee702b..2ab2a15403 100644 --- a/packages/nodes-base/nodes/Xero/Xero.node.ts +++ b/packages/nodes-base/nodes/Xero/Xero.node.ts @@ -445,7 +445,7 @@ export class Xero implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await xeroApiRequest.call( this, 'GET', @@ -598,7 +598,7 @@ export class Xero implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); responseData = await xeroApiRequest.call( this, 'GET', diff --git a/packages/nodes-base/nodes/Zammad/Zammad.node.ts b/packages/nodes-base/nodes/Zammad/Zammad.node.ts index ef6d1985a1..c992fb5d2e 100644 --- a/packages/nodes-base/nodes/Zammad/Zammad.node.ts +++ b/packages/nodes-base/nodes/Zammad/Zammad.node.ts @@ -434,7 +434,7 @@ export class Zammad implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); - const limit = returnAll ? 0 : (this.getNodeParameter('limit', i) as number); + const limit = returnAll ? 0 : this.getNodeParameter('limit', i); responseData = await zammadApiRequestAllItems .call(this, 'GET', '/users/search', {}, qs, limit) @@ -542,7 +542,7 @@ export class Zammad implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); - const limit = returnAll ? 0 : (this.getNodeParameter('limit', i) as number); + const limit = returnAll ? 0 : this.getNodeParameter('limit', i); responseData = await zammadApiRequestAllItems.call( this, @@ -641,7 +641,7 @@ export class Zammad implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); - const limit = returnAll ? 0 : (this.getNodeParameter('limit', i) as number); + const limit = returnAll ? 0 : this.getNodeParameter('limit', i); responseData = await zammadApiRequestAllItems.call( this, @@ -732,7 +732,7 @@ export class Zammad implements INodeType { const returnAll = this.getNodeParameter('returnAll', i); - const limit = returnAll ? 0 : (this.getNodeParameter('limit', i) as number); + const limit = returnAll ? 0 : this.getNodeParameter('limit', i); responseData = await zammadApiRequestAllItems.call( this, diff --git a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts index c895eb7b74..d6a91abfdf 100644 --- a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts +++ b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts @@ -450,7 +450,7 @@ export class Zendesk implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; responseData = await zendeskApiRequest.call(this, 'GET', endpoint, {}, qs); responseData = responseData.results || responseData.suspended_tickets; @@ -508,7 +508,7 @@ export class Zendesk implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.limit = limit; responseData = await zendeskApiRequestAllItems.call( this, @@ -600,7 +600,7 @@ export class Zendesk implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; responseData = await zendeskApiRequest.call(this, 'GET', `/users`, {}, qs); responseData = responseData.users; @@ -634,7 +634,7 @@ export class Zendesk implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; responseData = await zendeskApiRequest.call(this, 'GET', `/users/search`, {}, qs); responseData = responseData.users; @@ -733,7 +733,7 @@ export class Zendesk implements INodeType { qs, ); } else { - const limit = this.getNodeParameter('limit', i) as number; + const limit = this.getNodeParameter('limit', i); qs.per_page = limit; responseData = await zendeskApiRequest.call(this, 'GET', `/organizations`, {}, qs); responseData = responseData.organizations; diff --git a/packages/nodes-base/nodes/Zoho/GenericFunctions.ts b/packages/nodes-base/nodes/Zoho/GenericFunctions.ts index a61a8aa026..8f98bdf09e 100644 --- a/packages/nodes-base/nodes/Zoho/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoho/GenericFunctions.ts @@ -108,7 +108,7 @@ export async function handleListing( } const responseData = await zohoApiRequestAllItems.call(this, method, endpoint, body, qs); - const limit = this.getNodeParameter('limit', 0) as number; + const limit = this.getNodeParameter('limit', 0); return responseData.slice(0, limit); } diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index c2fd2bd48a..f29eac7f1a 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -198,7 +198,7 @@ export class Zoom implements INodeType { qs, ); } else { - qs.page_size = this.getNodeParameter('limit', i) as number; + qs.page_size = this.getNodeParameter('limit', i); responseData = await zoomApiRequest.call(this, 'GET', '/users/me/meetings', {}, qs); responseData = responseData.meetings; } @@ -499,7 +499,7 @@ export class Zoom implements INodeType { // if (returnAll) { // responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/meetings/${meetingId}/registrants`, {}, qs); // } else { - // qs.page_size = this.getNodeParameter('limit', i) as number; + // qs.page_size = this.getNodeParameter('limit', i); // responseData = await zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}/registrants`, {}, qs); // } @@ -652,7 +652,7 @@ export class Zoom implements INodeType { // if (returnAll) { // responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/webinars`, {}, qs); // } else { - // qs.page_size = this.getNodeParameter('limit', i) as number; + // qs.page_size = this.getNodeParameter('limit', i); // responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/webinars`, {}, qs); // } diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index 32346f7e29..c2fd2ed644 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -550,6 +550,10 @@ export interface IGetNodeParameterOptions { } namespace ExecuteFunctions { + namespace NumberReturning { + export type NodeParameter = 'limit'; + } + namespace BooleanReturning { export type NodeParameter = | 'binaryData' @@ -570,9 +574,15 @@ namespace ExecuteFunctions { getNodeParameter( parameterName: BooleanReturning.NodeParameter, itemIndex: number, - fallbackValue?: any, + fallbackValue?: boolean, options?: IGetNodeParameterOptions, ): boolean; + getNodeParameter( + parameterName: NumberReturning.NodeParameter, + itemIndex: number, + fallbackValue?: number, + options?: IGetNodeParameterOptions, + ): number; getNodeParameter( parameterName: string, itemIndex: number, @@ -594,17 +604,6 @@ export type IExecuteFunctions = ExecuteFunctions.GetNodeParameterFn & { getInputData(inputIndex?: number, inputName?: string): INodeExecutionData[]; getMode(): WorkflowExecuteMode; getNode(): INode; - getNodeParameter( - parameterName: 'resource', - itemIndex?: number, - ): T['resource']; - // getNodeParameter(parameterName: 'operation', itemIndex?: number): string; - getNodeParameter( - parameterName: string, - itemIndex: number, - fallbackValue?: any, - options?: IGetNodeParameterOptions, - ): NodeParameterValueType | object; getWorkflowDataProxy(itemIndex: number): IWorkflowDataProxyData; getWorkflowStaticData(type: string): IDataObject; getRestApiUrl(): string;