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:
Elias Meire
2024-02-14 16:29:09 +01:00
committed by GitHub
parent 24859cfef5
commit 100d9bc087
330 changed files with 1682 additions and 1492 deletions

View File

@@ -7,6 +7,7 @@ import type {
INodeType,
INodeTypeDescription,
JsonObject,
IHttpRequestMethods,
} from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
@@ -1169,7 +1170,7 @@ export class Salesforce implements INodeType {
}
}
let endpoint = '/sobjects/lead';
let method = 'POST';
let method: IHttpRequestMethods = 'POST';
if (operation === 'upsert') {
method = 'PATCH';
const externalId = this.getNodeParameter('externalId', 0) as string;
@@ -1497,7 +1498,7 @@ export class Salesforce implements INodeType {
}
}
let endpoint = '/sobjects/contact';
let method = 'POST';
let method: IHttpRequestMethods = 'POST';
if (operation === 'upsert') {
method = 'PATCH';
const externalId = this.getNodeParameter('externalId', 0) as string;
@@ -1749,7 +1750,7 @@ export class Salesforce implements INodeType {
body.RecordTypeId = additionalFields.recordTypeId as string;
}
let endpoint = `/sobjects/${customObject}`;
let method = 'POST';
let method: IHttpRequestMethods = 'POST';
if (operation === 'upsert') {
method = 'PATCH';
const externalId = this.getNodeParameter('externalId', 0) as string;
@@ -1944,7 +1945,7 @@ export class Salesforce implements INodeType {
}
}
let endpoint = '/sobjects/opportunity';
let method = 'POST';
let method: IHttpRequestMethods = 'POST';
if (operation === 'upsert') {
method = 'PATCH';
const externalId = this.getNodeParameter('externalId', 0) as string;
@@ -2193,7 +2194,7 @@ export class Salesforce implements INodeType {
}
}
let endpoint = '/sobjects/account';
let method = 'POST';
let method: IHttpRequestMethods = 'POST';
if (operation === 'upsert') {
method = 'PATCH';
const externalId = this.getNodeParameter('externalId', 0) as string;