mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(core): Introduce overload for record-type node parameter (no-changelog) (#4648)
* 📘 Set up overload * 🔥 Remove inferrable record assertions * 👕 Fix semicolon * 👕 Fix another semicolon
This commit is contained in:
@@ -554,7 +554,7 @@ export class Mautic implements INodeType {
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const simple = this.getNodeParameter('simple', i) as boolean;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
qs = Object.assign(qs, additionalFields);
|
||||
if (returnAll === true) {
|
||||
responseData = await mauticApiRequestAllItems.call(
|
||||
@@ -599,8 +599,8 @@ export class Mautic implements INodeType {
|
||||
if (resource === 'contact') {
|
||||
//https://developer.mautic.org/?php#create-contact
|
||||
if (operation === 'create') {
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const jsonActive = this.getNodeParameter('jsonParameters', i);
|
||||
let body: IDataObject = {};
|
||||
if (!jsonActive) {
|
||||
@@ -703,8 +703,8 @@ export class Mautic implements INodeType {
|
||||
}
|
||||
//https://developer.mautic.org/?php#edit-contact
|
||||
if (operation === 'update') {
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
let body: IDataObject = {};
|
||||
if (updateFields.email) {
|
||||
@@ -823,7 +823,7 @@ export class Mautic implements INodeType {
|
||||
}
|
||||
//https://developer.mautic.org/?php#get-contact
|
||||
if (operation === 'get') {
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
responseData = await mauticApiRequest.call(this, 'GET', `/contacts/${contactId}`);
|
||||
responseData = [responseData.contact];
|
||||
@@ -834,7 +834,7 @@ export class Mautic implements INodeType {
|
||||
//https://developer.mautic.org/?php#list-contacts
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
qs = Object.assign(qs, options);
|
||||
if (qs.orderBy) {
|
||||
// For some reason does camelCase get used in the returned data
|
||||
@@ -869,7 +869,7 @@ export class Mautic implements INodeType {
|
||||
}
|
||||
//https://developer.mautic.org/?php#delete-contact
|
||||
if (operation === 'delete') {
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
responseData = await mauticApiRequest.call(
|
||||
this,
|
||||
@@ -899,7 +899,7 @@ export class Mautic implements INodeType {
|
||||
const channel = this.getNodeParameter('channel', i) as string;
|
||||
const body: IDataObject = {};
|
||||
if (action === 'add') {
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
Object.assign(body, additionalFields);
|
||||
}
|
||||
responseData = await mauticApiRequest.call(
|
||||
|
||||
Reference in New Issue
Block a user