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

@@ -145,7 +145,7 @@ export class SendGrid implements INodeType {
if (operation === 'getAll') {
for (let i = 0; i < length; i++) {
try {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
const filters = this.getNodeParameter('filters', i) as IDataObject;
let endpoint = '/marketing/contacts';
let method = 'GET';
@@ -169,14 +169,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;
@@ -210,14 +210,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;
@@ -307,7 +307,7 @@ export class SendGrid implements INodeType {
returnData.push(responseData);
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ json:{ error: error.message } });
returnData.push({ json: { error: error.message } });
} else {
throw error;
}
@@ -331,7 +331,7 @@ 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) {
@@ -352,7 +352,7 @@ export class SendGrid implements INodeType {
if (operation === 'getAll') {
for (let i = 0; i < length; i++) {
try {
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
const returnAll = this.getNodeParameter('returnAll', i);
responseData = await sendGridApiRequestAllItems.call(
this,
`/marketing/lists`,