mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
* 👕 Enable `consistent-type-imports` for nodes-base * 👕 Apply to nodes-base * ⏪ Undo unrelated changes * 🚚 Move to `.eslintrc.js` in nodes-base * ⏪ Revert "Enable `consistent-type-imports` for nodes-base" This reverts commit 529ad72b051478fa1633aaf84b2864f2fdc7613c. * 👕 Fix severity
35 lines
767 B
TypeScript
35 lines
767 B
TypeScript
import type { IExecuteFunctions, IHookFunctions } from 'n8n-core';
|
|
|
|
import type { IDataObject, ILoadOptionsFunctions } from 'n8n-workflow';
|
|
|
|
import type { OptionsWithUri } from 'request';
|
|
|
|
/**
|
|
* Make an authenticated API request to Bubble.
|
|
*/
|
|
export async function dropcontactApiRequest(
|
|
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
|
method: string,
|
|
endpoint: string,
|
|
body: IDataObject,
|
|
qs: IDataObject,
|
|
) {
|
|
const options: OptionsWithUri = {
|
|
method,
|
|
uri: `https://api.dropcontact.io${endpoint}`,
|
|
qs,
|
|
body,
|
|
json: true,
|
|
};
|
|
|
|
if (!Object.keys(body).length) {
|
|
delete options.body;
|
|
}
|
|
|
|
if (!Object.keys(qs).length) {
|
|
delete options.qs;
|
|
}
|
|
|
|
return this.helpers.requestWithAuthentication.call(this, 'dropcontactApi', options);
|
|
}
|