feat(HTTP Request Node): Add pagination support (#5993)

Is still WIP and does not implement the correct UI yet.

Github issue / Community forum post (link here to close automatically):
https://community.n8n.io/t/pagination-included-into-http-node/15080

https://community.n8n.io/t/how-to-paginate-through-data-in-http-requests/28103
This commit is contained in:
Jan Oberhauser
2023-11-01 14:24:43 +01:00
committed by GitHub
parent 9bdb85c4ce
commit cc2bd2e19c
7 changed files with 2408 additions and 238 deletions

View File

@@ -1,5 +1,6 @@
import {
EnterpriseEditionFeature,
HTTP_REQUEST_NODE_TYPE,
MODAL_CONFIRM,
PLACEHOLDER_EMPTY_WORKFLOW_ID,
PLACEHOLDER_FILLED_AT_EXECUTION_TIME,
@@ -49,7 +50,7 @@ import { externalHooks } from '@/mixins/externalHooks';
import { genericHelpers } from '@/mixins/genericHelpers';
import { nodeHelpers } from '@/mixins/nodeHelpers';
import { isEqual } from 'lodash-es';
import { get, isEqual } from 'lodash-es';
import type { IPermissions } from '@/permissions';
import { getWorkflowPermissions } from '@/permissions';
@@ -194,6 +195,16 @@ export function resolveParameter(
...opts.additionalKeys,
};
if (activeNode?.type === HTTP_REQUEST_NODE_TYPE) {
// Add $response for HTTP Request-Nodes as it is used
// in pagination expressions
additionalKeys.$response = get(
executionData,
`data.executionData.contextData['node:${activeNode!.name}'].response`,
{},
);
}
let runIndexCurrent = opts?.targetItem?.runIndex ?? 0;
if (
opts?.targetItem === undefined &&