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

@@ -258,7 +258,7 @@ export class GmailV2 implements INodeType {
responseData = await googleApiRequest.call(this, 'GET', endpoint);
}
if (operation === 'getAll') {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
responseData = await googleApiRequest.call(this, 'GET', `/gmail/v1/users/me/labels`);
@@ -379,7 +379,7 @@ export class GmailV2 implements INodeType {
responseData = [nodeExecutionData];
}
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;
const filters = this.getNodeParameter('filters', i, {}) as IDataObject;
const qs: IDataObject = {};
@@ -605,7 +605,7 @@ export class GmailV2 implements INodeType {
responseData = { success: true };
}
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;
const qs: IDataObject = {};
Object.assign(qs, options);
@@ -705,7 +705,7 @@ export class GmailV2 implements INodeType {
}
if (operation === 'getAll') {
//https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const filters = this.getNodeParameter('filters', i) as IDataObject;
const qs: IDataObject = {};
Object.assign(qs, prepareQuery.call(this, filters));