mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor(core): Extract execute-single context out of NodeExecutionFunctions (no-changelog) (#11543)
This commit is contained in:
committed by
GitHub
parent
c1a7f68236
commit
ccd2564cd4
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user