mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -24,6 +24,7 @@ import {
|
||||
getTaskMetadata,
|
||||
hubspotApiRequest,
|
||||
hubspotApiRequestAllItems,
|
||||
validateCredentials,
|
||||
} from './GenericFunctions';
|
||||
|
||||
import { contactFields, contactOperations } from './ContactDescription';
|
||||
@@ -46,7 +47,6 @@ import { IAssociation, IDeal } from './DealInterface';
|
||||
|
||||
import { snakeCase } from 'change-case';
|
||||
|
||||
import { validateCredentials } from './GenericFunctions';
|
||||
export class Hubspot implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'HubSpot',
|
||||
@@ -1303,7 +1303,6 @@ export class Hubspot implements INodeType {
|
||||
|
||||
if (resolveData) {
|
||||
const isNew = responseData.isNew;
|
||||
const qs: IDataObject = {};
|
||||
if (additionalFields.properties) {
|
||||
qs.property = additionalFields.properties as string[];
|
||||
}
|
||||
@@ -1324,8 +1323,8 @@ export class Hubspot implements INodeType {
|
||||
if (additionalFields.formSubmissionMode) {
|
||||
qs.formSubmissionMode = additionalFields.formSubmissionMode as string;
|
||||
}
|
||||
if (additionalFields.listMerberships) {
|
||||
qs.showListMemberships = additionalFields.listMerberships as boolean;
|
||||
if (additionalFields.listMemberships) {
|
||||
qs.showListMemberships = additionalFields.listMemberships as boolean;
|
||||
}
|
||||
if (additionalFields.properties) {
|
||||
qs.property = additionalFields.properties as string[];
|
||||
@@ -1343,8 +1342,8 @@ export class Hubspot implements INodeType {
|
||||
if (additionalFields.formSubmissionMode) {
|
||||
qs.formSubmissionMode = additionalFields.formSubmissionMode as string;
|
||||
}
|
||||
if (additionalFields.listMerberships) {
|
||||
qs.showListMemberships = additionalFields.listMerberships as boolean;
|
||||
if (additionalFields.listMemberships) {
|
||||
qs.showListMemberships = additionalFields.listMemberships as boolean;
|
||||
}
|
||||
if (additionalFields.properties) {
|
||||
qs.property = additionalFields.properties as string[];
|
||||
@@ -1370,14 +1369,13 @@ export class Hubspot implements INodeType {
|
||||
}
|
||||
//https://developers.hubspot.com/docs/methods/contacts/get_recently_created_contacts
|
||||
if (operation === 'getRecentlyCreatedUpdated') {
|
||||
let endpoint;
|
||||
const returnAll = this.getNodeParameter('returnAll', 0);
|
||||
const filters = this.getNodeParameter('filters', i);
|
||||
if (filters.formSubmissionMode) {
|
||||
qs.formSubmissionMode = filters.formSubmissionMode as string;
|
||||
}
|
||||
if (filters.listMerberships) {
|
||||
qs.showListMemberships = filters.listMerberships as boolean;
|
||||
if (filters.listMemberships) {
|
||||
qs.showListMemberships = filters.listMemberships as boolean;
|
||||
}
|
||||
if (filters.properties) {
|
||||
qs.property = filters.properties as string[];
|
||||
@@ -1386,7 +1384,7 @@ export class Hubspot implements INodeType {
|
||||
qs.propertyMode = snakeCase(filters.propertyMode as string);
|
||||
}
|
||||
|
||||
endpoint = '/contacts/v1/lists/recently_updated/contacts/recent';
|
||||
const endpoint = '/contacts/v1/lists/recently_updated/contacts/recent';
|
||||
|
||||
if (returnAll) {
|
||||
responseData = await hubspotApiRequestAllItems.call(
|
||||
@@ -1427,8 +1425,7 @@ export class Hubspot implements INodeType {
|
||||
};
|
||||
|
||||
if (filtersGroupsUi) {
|
||||
const filterGroupValues = (filtersGroupsUi as IDataObject)
|
||||
.filterGroupsValues as IDataObject[];
|
||||
const filterGroupValues = filtersGroupsUi.filterGroupsValues as IDataObject[];
|
||||
if (filterGroupValues) {
|
||||
body.filterGroups = [];
|
||||
for (const filterGroupValue of filterGroupValues) {
|
||||
@@ -2248,8 +2245,7 @@ export class Hubspot implements INodeType {
|
||||
};
|
||||
|
||||
if (filtersGroupsUi) {
|
||||
const filterGroupValues = (filtersGroupsUi as IDataObject)
|
||||
.filterGroupsValues as IDataObject[];
|
||||
const filterGroupValues = filtersGroupsUi.filterGroupsValues as IDataObject[];
|
||||
if (filterGroupValues) {
|
||||
body.filterGroups = [];
|
||||
for (const filterGroupValue of filterGroupValues) {
|
||||
@@ -2412,10 +2408,10 @@ export class Hubspot implements INodeType {
|
||||
const consent: IDataObject = {};
|
||||
if (legalConsent) {
|
||||
if (legalConsent.consentToProcess) {
|
||||
consent!.consentToProcess = legalConsent.consentToProcess as boolean;
|
||||
consent.consentToProcess = legalConsent.consentToProcess as boolean;
|
||||
}
|
||||
if (legalConsent.text) {
|
||||
consent!.text = legalConsent.text as string;
|
||||
consent.text = legalConsent.text as string;
|
||||
}
|
||||
if (legalConsent.communicationsUi) {
|
||||
consent.communications = (legalConsent.communicationsUi as IDataObject)
|
||||
|
||||
Reference in New Issue
Block a user