mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor: Add IRequestOptions type to helpers.request for more type safety (no-changelog) (#8563)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -6,6 +6,7 @@ import type {
|
||||
INodePropertyOptions,
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
IHttpRequestMethods,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
@@ -317,7 +318,7 @@ export class ActiveCampaign implements INodeType {
|
||||
// For Query string
|
||||
let qs: IDataObject;
|
||||
|
||||
let requestMethod: string;
|
||||
let requestMethod: IHttpRequestMethods;
|
||||
let endpoint: string;
|
||||
let returnAll = false;
|
||||
let dataKey: string | undefined;
|
||||
|
||||
@@ -5,11 +5,11 @@ import type {
|
||||
ILoadOptionsFunctions,
|
||||
INodeProperties,
|
||||
JsonObject,
|
||||
IRequestOptions,
|
||||
IHttpRequestMethods,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
export interface IProduct {
|
||||
fields: {
|
||||
item?: object[];
|
||||
@@ -22,7 +22,7 @@ export interface IProduct {
|
||||
*/
|
||||
export async function activeCampaignApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
body: IDataObject,
|
||||
query?: IDataObject,
|
||||
@@ -34,7 +34,7 @@ export async function activeCampaignApiRequest(
|
||||
query = {};
|
||||
}
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
const options: IRequestOptions = {
|
||||
headers: {},
|
||||
method,
|
||||
qs: query,
|
||||
@@ -75,7 +75,7 @@ export async function activeCampaignApiRequest(
|
||||
*/
|
||||
export async function activeCampaignApiRequestAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
body: IDataObject,
|
||||
query?: IDataObject,
|
||||
|
||||
Reference in New Issue
Block a user