mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
* ⚡ Add company resource to Mautic
* ⚡ Add company resource * ⚡ Small improvement * Tweak descriptions/ labels Added descriptions for resources + fixed a spelling mistake (all just editing "description" fields, nothing else) * 👕 Fix lint issue Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: maxtkacz <maxtkacz@gmail.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { OptionsWithUri } from 'request';
|
||||
import {
|
||||
OptionsWithUri,
|
||||
} from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
@@ -48,11 +50,12 @@ export async function mauticApiRequest(this: IHookFunctions | IExecuteFunctions
|
||||
if (authenticationMethod === 'credentials') {
|
||||
const credentials = this.getCredentials('mauticApi') as IDataObject;
|
||||
|
||||
const base64Key = Buffer.from(`${credentials.username}:${credentials.password}`).toString('base64');
|
||||
const base64Key = Buffer.from(`${credentials.username}:${credentials.password}`).toString('base64');
|
||||
|
||||
options.headers!.Authorization = `Basic ${base64Key}`;
|
||||
|
||||
options.uri = `${credentials.url}${options.uri}`;
|
||||
|
||||
//@ts-ignore
|
||||
returnData = await this.helpers.request(options);
|
||||
} else {
|
||||
@@ -102,7 +105,7 @@ export async function mauticApiRequestAllItems(this: IHookFunctions | IExecuteFu
|
||||
} while (
|
||||
responseData.total !== undefined &&
|
||||
((query.limit * query.start) - parseInt(responseData.total, 10)) < 0
|
||||
);
|
||||
);
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user