refactor(core): Extract execute-single context out of NodeExecutionFunctions (no-changelog) (#11543)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-11-06 10:36:21 +01:00
committed by GitHub
parent c1a7f68236
commit ccd2564cd4
5 changed files with 555 additions and 160 deletions

View File

@@ -42,6 +42,7 @@ import type {
JsonObject,
CloseFunction,
INodeCredentialDescription,
IExecutePaginationFunctions,
} from './Interfaces';
import * as NodeHelpers from './NodeHelpers';
import { sleep } from './utils';
@@ -623,27 +624,28 @@ export class RoutingNode {
);
}
const executePaginationFunctions = {
...executeSingleFunctions,
makeRoutingRequest: async (requestOptions: DeclarativeRestApiSettings.ResultOptions) => {
return await this.rawRoutingRequest(
executeSingleFunctions,
requestOptions,
credentialType,
credentialsDecrypted,
).then(
async (data) =>
await this.postProcessResponseData(
executeSingleFunctions,
data,
requestData,
itemIndex,
runIndex,
),
);
},
const makeRoutingRequest = async (requestOptions: DeclarativeRestApiSettings.ResultOptions) => {
return await this.rawRoutingRequest(
executeSingleFunctions,
requestOptions,
credentialType,
credentialsDecrypted,
).then(
async (data) =>
await this.postProcessResponseData(
executeSingleFunctions,
data,
requestData,
itemIndex,
runIndex,
),
);
};
const executePaginationFunctions = Object.create(executeSingleFunctions, {
makeRoutingRequest: { value: makeRoutingRequest },
}) as IExecutePaginationFunctions;
if (requestData.paginate && requestOperations?.pagination) {
// Has pagination