refactor(core): Remove linting exceptions in nodes-base (#4794)

*  enabled array-type

*  await-thenable on

*  ban-types on

*  default-param-last on

*  dot-notation on

*  member-delimiter-style on

*  no-duplicate-imports on

*  no-empty-interface on

*  no-floating-promises on

*  no-for-in-array on

*  no-invalid-void-type on

*  no-loop-func on

*  no-shadow on

*  ban-ts-comment re enabled

*  @typescript-eslint/lines-between-class-members on

* address my own comment

* @typescript-eslint/return-await on

* @typescript-eslint/promise-function-async on

* @typescript-eslint/no-unnecessary-boolean-literal-compare on

* @typescript-eslint/no-unnecessary-type-assertion on

* prefer-const on

* @typescript-eslint/prefer-optional-chain on

Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
Michael Kret
2022-12-02 22:54:28 +02:00
committed by GitHub
parent 8101c05d6f
commit 61e26804ba
796 changed files with 3735 additions and 2847 deletions

View File

@@ -121,11 +121,7 @@ export async function pipedriveApiRequestAllItems(
}
query.start = responseData.additionalData.pagination.next_start;
} while (
responseData.additionalData !== undefined &&
responseData.additionalData.pagination !== undefined &&
responseData.additionalData.pagination.more_items_in_collection === true
);
} while (responseData.additionalData?.pagination?.more_items_in_collection === true);
return {
data: returnData,
@@ -190,7 +186,7 @@ export function pipedriveEncodeCustomProperties(
for (const key of Object.keys(item)) {
customPropertyData = Object.values(customProperties).find(
(customPropertyData) => customPropertyData.name === key,
(propertyData) => propertyData.name === key,
);
if (customPropertyData !== undefined) {
@@ -209,12 +205,12 @@ export function pipedriveEncodeCustomProperties(
);
if (propertyOption !== undefined) {
item[customPropertyData.key as string] = propertyOption.id;
item[customPropertyData.key] = propertyOption.id;
delete item[key];
}
} else {
// Does already represent the actual value or is null
item[customPropertyData.key as string] = item[key];
item[customPropertyData.key] = item[key];
delete item[key];
}
}
@@ -265,7 +261,7 @@ export function pipedriveResolveCustomProperties(
'timerange',
].includes(customPropertyData.field_type)
) {
json[customPropertyData.name as string] = json[key];
json[customPropertyData.name] = json[key];
delete json[key];
// type options
} else if (
@@ -276,7 +272,7 @@ export function pipedriveResolveCustomProperties(
(option) => option.id.toString() === json[key]!.toString(),
);
if (propertyOption !== undefined) {
json[customPropertyData.name as string] = propertyOption.label;
json[customPropertyData.name] = propertyOption.label;
delete json[key];
}
// type multioptions

View File

@@ -3763,7 +3763,7 @@ export class Pipedrive implements INodeType {
'GET',
'/filters',
{},
{ type: type[resource] as string },
{ type: type[resource] },
);
for (const filter of data) {
returnData.push({
@@ -4052,7 +4052,7 @@ export class Pipedrive implements INodeType {
getCustomProperties = this.getNodeParameter('resolveProperties', 0, false) as boolean;
}
if (getCustomProperties === true) {
if (getCustomProperties) {
customProperties = await pipedriveGetCustomProperties.call(this, resource);
}
}
@@ -4106,7 +4106,7 @@ export class Pipedrive implements INodeType {
requestMethod = 'GET';
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4194,7 +4194,7 @@ export class Pipedrive implements INodeType {
requestMethod = 'GET';
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
const filters = this.getNodeParameter('filters', i);
@@ -4227,7 +4227,7 @@ export class Pipedrive implements INodeType {
qs.term = this.getNodeParameter('term', i) as string;
returnAll = this.getNodeParameter('returnAll', i);
qs.exact_match = this.getNodeParameter('exactMatch', i) as boolean;
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4265,7 +4265,7 @@ export class Pipedrive implements INodeType {
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4275,7 +4275,7 @@ export class Pipedrive implements INodeType {
qs.exclude = additionalFields.exclude as string;
}
if (additionalFields && additionalFields.done !== undefined) {
if (additionalFields?.done !== undefined) {
qs.done = additionalFields.done === true ? 1 : 0;
}
@@ -4437,7 +4437,7 @@ export class Pipedrive implements INodeType {
endpoint = `/notes`;
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
const additionalFields = this.getNodeParameter('additionalFields', i);
@@ -4536,7 +4536,7 @@ export class Pipedrive implements INodeType {
// https://developers.pipedrive.com/docs/api/v1/Leads#getLeads
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4627,7 +4627,7 @@ export class Pipedrive implements INodeType {
requestMethod = 'GET';
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4668,7 +4668,7 @@ export class Pipedrive implements INodeType {
qs.term = this.getNodeParameter('term', i) as string;
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4724,7 +4724,7 @@ export class Pipedrive implements INodeType {
requestMethod = 'GET';
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4748,7 +4748,7 @@ export class Pipedrive implements INodeType {
qs.term = this.getNodeParameter('term', i) as string;
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4797,7 +4797,7 @@ export class Pipedrive implements INodeType {
requestMethod = 'GET';
returnAll = this.getNodeParameter('returnAll', i);
if (returnAll === false) {
if (!returnAll) {
qs.limit = this.getNodeParameter('limit', i);
}
@@ -4810,7 +4810,7 @@ export class Pipedrive implements INodeType {
}
let responseData;
if (returnAll === true) {
if (returnAll) {
responseData = await pipedriveApiRequestAllItems.call(
this,
requestMethod,
@@ -4820,7 +4820,7 @@ export class Pipedrive implements INodeType {
);
} else {
if (customProperties !== undefined) {
pipedriveEncodeCustomProperties(customProperties!, body);
pipedriveEncodeCustomProperties(customProperties, body);
}
responseData = await pipedriveApiRequest.call(

View File

@@ -344,8 +344,8 @@ export class PipedriveTrigger implements INodeType {
}
if (
basicAuthData.name !== httpBasicAuth!.user ||
basicAuthData.pass !== httpBasicAuth!.password
basicAuthData.name !== httpBasicAuth.user ||
basicAuthData.pass !== httpBasicAuth.password
) {
// Provided authentication data is wrong
return authorizationError(resp, realm, 403);