refactor(core): Introduce overload for boolean-type node parameter (no-changelog) (#4647)

* 📘 Set up overloads

* 📘 Add temporary assertion

* 🔥 Remove inferrable boolean assertions

*  Undo autoformatting
This commit is contained in:
Iván Ovejero
2022-11-18 14:31:38 +01:00
committed by GitHub
parent 919cb9180d
commit 6757c9a2ea
163 changed files with 559 additions and 529 deletions

View File

@@ -162,7 +162,7 @@ export class HelpScout implements INodeType {
const status = this.getNodeParameter('status', i) as string;
const subject = this.getNodeParameter('subject', i) as string;
const type = this.getNodeParameter('type', i) as string;
const resolveData = this.getNodeParameter('resolveData', i) as boolean;
const resolveData = this.getNodeParameter('resolveData', i);
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const threads = (this.getNodeParameter('threadsUi', i) as IDataObject)
.threadsValues as IDataObject[];
@@ -246,7 +246,7 @@ export class HelpScout implements INodeType {
}
//https://developer.helpscout.com/mailbox-api/endpoints/conversations/list
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const options = this.getNodeParameter('options', i) as IDataObject;
Object.assign(qs, options);
if (returnAll) {
@@ -275,7 +275,7 @@ export class HelpScout implements INodeType {
if (resource === 'customer') {
//https://developer.helpscout.com/mailbox-api/endpoints/customers/create
if (operation === 'create') {
const resolveData = this.getNodeParameter('resolveData', i) as boolean;
const resolveData = this.getNodeParameter('resolveData', i);
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
const chats = (this.getNodeParameter('chatsUi', i) as IDataObject)
.chatsValues as IDataObject[];
@@ -360,7 +360,7 @@ export class HelpScout implements INodeType {
}
//https://developer.helpscout.com/mailbox-api/endpoints/customers/list
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const options = this.getNodeParameter('options', i) as IDataObject;
Object.assign(qs, options);
if (returnAll) {
@@ -425,7 +425,7 @@ export class HelpScout implements INodeType {
}
//https://developer.helpscout.com/mailbox-api/endpoints/mailboxes/list
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
if (returnAll) {
responseData = await helpscoutApiRequestAllItems.call(
this,
@@ -534,7 +534,7 @@ export class HelpScout implements INodeType {
}
//https://developer.helpscout.com/mailbox-api/endpoints/conversations/threads/list
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const conversationId = this.getNodeParameter('conversationId', i) as string;
if (returnAll) {
responseData = await helpscoutApiRequestAllItems.call(