mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +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:
@@ -2,9 +2,11 @@ import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
IHttpRequestMethods,
|
||||
ILoadOptionsFunctions,
|
||||
INodeExecutionData,
|
||||
INodePropertyOptions,
|
||||
IRequestOptions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
@@ -14,7 +16,6 @@ import { capitalCase } from 'change-case';
|
||||
import omit from 'lodash/omit';
|
||||
import pickBy from 'lodash/pickBy';
|
||||
|
||||
import type { OptionsWithUri } from 'request';
|
||||
import type { CustomField, GeneralAddress, Ref } from './descriptions/Shared.interface';
|
||||
|
||||
import type { DateFieldsUi, Option, QuickBooksOAuth2Credentials, TransactionReport } from './types';
|
||||
@@ -24,7 +25,7 @@ import type { DateFieldsUi, Option, QuickBooksOAuth2Credentials, TransactionRepo
|
||||
*/
|
||||
export async function quickBooksApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
qs: IDataObject,
|
||||
body: IDataObject,
|
||||
@@ -46,7 +47,7 @@ export async function quickBooksApiRequest(
|
||||
'quickBooksOAuth2Api',
|
||||
)) as QuickBooksOAuth2Credentials;
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
const options: IRequestOptions = {
|
||||
headers: {
|
||||
'user-agent': 'n8n',
|
||||
},
|
||||
@@ -93,7 +94,7 @@ export async function quickBooksApiRequest(
|
||||
|
||||
async function getCount(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
qs: IDataObject,
|
||||
): Promise<any> {
|
||||
@@ -107,7 +108,7 @@ async function getCount(
|
||||
*/
|
||||
export async function quickBooksApiRequestAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
endpoint: string,
|
||||
qs: IDataObject,
|
||||
body: IDataObject,
|
||||
|
||||
Reference in New Issue
Block a user