refactor: Reduce usage of IExecuteSingleFunctions (no-changelog) (#6944)
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import type { OptionsWithUri } from 'request';
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -9,7 +8,7 @@ import type {
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: IDataObject = {},
|
||||
|
||||
@@ -2,14 +2,13 @@ import type { OptionsWithUri } from 'request';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: IDataObject = {},
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -11,7 +10,7 @@ import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
body: any = {},
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { OptionsWithUri } from 'request';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
@@ -11,7 +10,7 @@ import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../../../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
body: IDataObject = {},
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -11,7 +10,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
body: any = {},
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { OptionsWithUri } from 'request';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeListSearchItems,
|
||||
INodeListSearchResult,
|
||||
@@ -15,7 +14,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { OptionsWithUri } from 'request';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INodeProperties,
|
||||
JsonObject,
|
||||
@@ -13,7 +12,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -10,7 +9,7 @@ import type {
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -10,7 +9,7 @@ import type {
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
IPollFunctions,
|
||||
@@ -13,7 +12,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
body: any = {},
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
IPollFunctions,
|
||||
@@ -12,7 +11,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../../../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
method: IHttpRequestMethods,
|
||||
resource: string,
|
||||
body: IDataObject | string | Buffer = {},
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -12,7 +11,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import moment from 'moment-timezone';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUrl } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -10,7 +9,7 @@ import type {
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
projectId: string,
|
||||
method: string,
|
||||
resource: string,
|
||||
@@ -54,7 +53,7 @@ export async function googleApiRequest(
|
||||
}
|
||||
|
||||
export async function googleApiRequestAllItems(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
projectId: string,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -10,7 +9,7 @@ import type {
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
ICredentialTestFunctions,
|
||||
IDataObject,
|
||||
@@ -58,12 +57,7 @@ const googleServiceAccountScopes = {
|
||||
type GoogleServiceAccount = keyof typeof googleServiceAccountScopes;
|
||||
|
||||
export async function getGoogleAccessToken(
|
||||
this:
|
||||
| IExecuteFunctions
|
||||
| IExecuteSingleFunctions
|
||||
| ILoadOptionsFunctions
|
||||
| ICredentialTestFunctions
|
||||
| IPollFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | ICredentialTestFunctions | IPollFunctions,
|
||||
credentials: IDataObject,
|
||||
service: GoogleServiceAccount,
|
||||
): Promise<IDataObject> {
|
||||
|
||||
@@ -6,7 +6,6 @@ import type {
|
||||
IBinaryKeyData,
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
INode,
|
||||
INodeExecutionData,
|
||||
@@ -43,7 +42,7 @@ import MailComposer from 'nodemailer/lib/mail-composer';
|
||||
import { getGoogleAccessToken } from '../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
method: string,
|
||||
endpoint: string,
|
||||
body: IDataObject = {},
|
||||
@@ -349,7 +348,7 @@ export const prepareTimestamp = (
|
||||
};
|
||||
|
||||
export function prepareQuery(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
fields: IDataObject,
|
||||
itemIndex: number,
|
||||
) {
|
||||
@@ -406,7 +405,7 @@ export function prepareQuery(
|
||||
}
|
||||
|
||||
export function prepareEmailsInput(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
input: string,
|
||||
fieldName: string,
|
||||
itemIndex: number,
|
||||
@@ -434,7 +433,7 @@ export function prepareEmailsInput(
|
||||
}
|
||||
|
||||
export function prepareEmailBody(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
itemIndex: number,
|
||||
) {
|
||||
const emailType = this.getNodeParameter('emailType', itemIndex) as string;
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { OptionsWithUri } from 'request';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
JsonObject,
|
||||
} from 'n8n-workflow';
|
||||
@@ -18,7 +17,7 @@ export interface IGoogleAuthCredentials {
|
||||
}
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
import type {
|
||||
IDataObject,
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IPollFunctions,
|
||||
JsonObject,
|
||||
@@ -11,7 +10,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../../../GenericFunctions';
|
||||
|
||||
export async function apiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
body: IDataObject = {},
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -10,7 +9,7 @@ import type {
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
body: IDataObject = {},
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -12,7 +11,7 @@ import { NodeApiError } from 'n8n-workflow';
|
||||
import { getGoogleAccessToken } from '../GenericFunctions';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { OptionsWithUri } from 'request';
|
||||
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IDataObject,
|
||||
JsonObject,
|
||||
@@ -10,7 +9,7 @@ import type {
|
||||
import { NodeApiError } from 'n8n-workflow';
|
||||
|
||||
export async function googleApiRequest(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
method: string,
|
||||
resource: string,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user