diff --git a/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts b/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts index 971cc8b189..2158078536 100644 --- a/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts @@ -1,16 +1,17 @@ import type { ICredentialType, INodeProperties } from 'n8n-workflow'; const scopes = [ - 'crm.schemas.deals.read', - 'crm.objects.owners.read', - 'crm.objects.contacts.write', - 'crm.objects.companies.write', - 'crm.objects.companies.read', - 'crm.objects.deals.read', - 'crm.schemas.contacts.read', - 'crm.objects.deals.write', + 'crm.lists.write', 'crm.objects.contacts.read', + 'crm.objects.contacts.write', + 'crm.objects.companies.read', + 'crm.objects.companies.write', + 'crm.objects.deals.read', + 'crm.objects.deals.write', + 'crm.objects.owners.read', 'crm.schemas.companies.read', + 'crm.schemas.contacts.read', + 'crm.schemas.deals.read', 'forms', 'tickets', ]; diff --git a/packages/nodes-base/nodes/Hubspot/V2/ContactListDescription.ts b/packages/nodes-base/nodes/Hubspot/V2/ContactListDescription.ts index b7c4f3dfaf..2f52c06956 100644 --- a/packages/nodes-base/nodes/Hubspot/V2/ContactListDescription.ts +++ b/packages/nodes-base/nodes/Hubspot/V2/ContactListDescription.ts @@ -86,7 +86,7 @@ export const contactListFields: INodeProperties[] = [ default: '', }, { - displayName: 'List to Add From', + displayName: 'List to Add To', name: 'listId', type: 'number', required: true, diff --git a/packages/nodes-base/nodes/Hubspot/V2/HubspotV2.node.ts b/packages/nodes-base/nodes/Hubspot/V2/HubspotV2.node.ts index 75db612b6b..727aeaf743 100644 --- a/packages/nodes-base/nodes/Hubspot/V2/HubspotV2.node.ts +++ b/packages/nodes-base/nodes/Hubspot/V2/HubspotV2.node.ts @@ -1152,7 +1152,6 @@ export class HubspotV2 implements INodeType { `/contacts/v1/lists/${listId}/add`, body, ); - returnData.push.apply(returnData, responseData as INodeExecutionData[]); } //https://legacydocs.hubspot.com/docs/methods/lists/remove_contact_from_list if (operation === 'remove') { @@ -1168,8 +1167,12 @@ export class HubspotV2 implements INodeType { `/contacts/v1/lists/${listId}/remove`, body, ); - returnData.push.apply(returnData, responseData as INodeExecutionData[]); } + const executionData = this.helpers.constructExecutionMetaData( + this.helpers.returnJsonArray(responseData as IDataObject[]), + { itemData: { item: 0 } }, + ); + returnData.push(...executionData); } catch (error) { if (this.continueOnFail()) { returnData.push({ json: { error: (error as JsonObject).message } });