mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +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:
@@ -4,15 +4,15 @@ import { sign } from 'aws4';
|
||||
|
||||
import get from 'lodash/get';
|
||||
|
||||
import type { OptionsWithUri } from 'request';
|
||||
|
||||
import { parseString } from 'xml2js';
|
||||
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
IHttpRequestMethods,
|
||||
ILoadOptionsFunctions,
|
||||
IRequestOptions,
|
||||
IWebhookFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
@@ -27,7 +27,7 @@ function queryToString(params: IDataObject) {
|
||||
export async function s3ApiRequest(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
|
||||
bucket: string,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
path: string,
|
||||
body?: string | Buffer,
|
||||
query: IDataObject = {},
|
||||
@@ -77,7 +77,7 @@ export async function s3ApiRequest(
|
||||
|
||||
sign(signOpts, securityHeaders);
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
const options: IRequestOptions = {
|
||||
headers: signOpts.headers,
|
||||
method,
|
||||
qs: query,
|
||||
@@ -98,7 +98,7 @@ export async function s3ApiRequest(
|
||||
export async function s3ApiRequestREST(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
|
||||
bucket: string,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
path: string,
|
||||
body?: string,
|
||||
query: IDataObject = {},
|
||||
@@ -127,7 +127,7 @@ export async function s3ApiRequestREST(
|
||||
export async function s3ApiRequestSOAP(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
|
||||
bucket: string,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
path: string,
|
||||
body?: string | Buffer,
|
||||
query: IDataObject = {},
|
||||
@@ -164,7 +164,7 @@ export async function s3ApiRequestSOAPAllItems(
|
||||
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,
|
||||
propertyName: string,
|
||||
service: string,
|
||||
method: string,
|
||||
method: IHttpRequestMethods,
|
||||
path: string,
|
||||
body?: string,
|
||||
query: IDataObject = {},
|
||||
|
||||
Reference in New Issue
Block a user