feat: Improvements to pairedItem
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
IDataObject,
|
||||
IDeferredPromise,
|
||||
IExecuteResponsePromiseData,
|
||||
IPinData,
|
||||
IRun,
|
||||
IRunData,
|
||||
IRunExecutionData,
|
||||
@@ -15,7 +16,6 @@ import {
|
||||
ITelemetrySettings,
|
||||
ITelemetryTrackProperties,
|
||||
IWorkflowBase as IWorkflowBaseWorkflow,
|
||||
PinData,
|
||||
Workflow,
|
||||
WorkflowExecuteMode,
|
||||
} from 'n8n-workflow';
|
||||
@@ -689,7 +689,7 @@ export interface IWorkflowExecutionDataProcess {
|
||||
executionMode: WorkflowExecuteMode;
|
||||
executionData?: IRunExecutionData;
|
||||
runData?: IRunData;
|
||||
pinData?: PinData;
|
||||
pinData?: IPinData;
|
||||
retryOf?: number | string;
|
||||
sessionId?: string;
|
||||
startNodes?: string[];
|
||||
|
||||
@@ -70,11 +70,11 @@ import {
|
||||
INodeType,
|
||||
INodeTypeDescription,
|
||||
INodeTypeNameVersion,
|
||||
IPinData,
|
||||
ITelemetrySettings,
|
||||
IWorkflowBase,
|
||||
LoggerProxy,
|
||||
NodeHelpers,
|
||||
PinData,
|
||||
WebhookHttpMethod,
|
||||
Workflow,
|
||||
WorkflowExecuteMode,
|
||||
@@ -2836,7 +2836,7 @@ const TRIGGER_NODE_SUFFIXES = ['trigger', 'webhook'];
|
||||
const isTrigger = (str: string) =>
|
||||
TRIGGER_NODE_SUFFIXES.some((suffix) => str.toLowerCase().includes(suffix));
|
||||
|
||||
function findFirstPinnedTrigger(workflow: IWorkflowDb, pinData?: PinData) {
|
||||
function findFirstPinnedTrigger(workflow: IWorkflowDb, pinData?: IPinData) {
|
||||
if (!pinData) return;
|
||||
|
||||
const firstPinnedTriggerName = Object.keys(pinData).find(isTrigger);
|
||||
|
||||
@@ -230,6 +230,7 @@ export class WorkflowRunnerProcess {
|
||||
nodeTypes,
|
||||
staticData: this.data.workflowData.staticData,
|
||||
settings: this.data.workflowData.settings,
|
||||
pinData: this.data.pinData,
|
||||
});
|
||||
await checkPermissionsForExecution(this.workflow, userId);
|
||||
const additionalData = await WorkflowExecuteAdditionalData.getBase(
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/* eslint-disable import/no-cycle */
|
||||
import { Length } from 'class-validator';
|
||||
|
||||
import { IConnections, IDataObject, INode, IWorkflowSettings, PinData } from 'n8n-workflow';
|
||||
import { IConnections, IDataObject, INode, IPinData, IWorkflowSettings } from 'n8n-workflow';
|
||||
|
||||
import {
|
||||
BeforeUpdate,
|
||||
@@ -122,7 +122,7 @@ export class WorkflowEntity implements IWorkflowDb {
|
||||
nullable: true,
|
||||
transformer: serializer,
|
||||
})
|
||||
pinData: PinData;
|
||||
pinData: IPinData;
|
||||
|
||||
@BeforeUpdate()
|
||||
setUpdateDate() {
|
||||
|
||||
4
packages/cli/src/requests.d.ts
vendored
4
packages/cli/src/requests.d.ts
vendored
@@ -6,9 +6,9 @@ import {
|
||||
ICredentialNodeAccess,
|
||||
INode,
|
||||
INodeCredentialTestRequest,
|
||||
IPinData,
|
||||
IRunData,
|
||||
IWorkflowSettings,
|
||||
PinData,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { User } from './databases/entities/User';
|
||||
@@ -72,7 +72,7 @@ export declare namespace WorkflowRequest {
|
||||
{
|
||||
workflowData: IWorkflowDb;
|
||||
runData: IRunData;
|
||||
pinData: PinData;
|
||||
pinData: IPinData;
|
||||
startNodes?: string[];
|
||||
destinationNode?: string;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as utils from './shared/utils';
|
||||
import * as testDb from './shared/testDb';
|
||||
import { WorkflowEntity } from '../../src/databases/entities/WorkflowEntity';
|
||||
import type { Role } from '../../src/databases/entities/Role';
|
||||
import { PinData } from 'n8n-workflow';
|
||||
import { IPinData } from 'n8n-workflow';
|
||||
|
||||
jest.mock('../../src/telemetry');
|
||||
|
||||
@@ -44,7 +44,7 @@ test('POST /workflows should store pin data for node in workflow', async () => {
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
|
||||
const { pinData } = response.body.data as { pinData: PinData };
|
||||
const { pinData } = response.body.data as { pinData: IPinData };
|
||||
|
||||
expect(pinData).toMatchObject({ Spotify: [{ myKey: 'myValue' }] });
|
||||
});
|
||||
@@ -59,7 +59,7 @@ test('POST /workflows should set pin data to null if no pin data', async () => {
|
||||
|
||||
expect(response.statusCode).toBe(200);
|
||||
|
||||
const { pinData } = response.body.data as { pinData: PinData };
|
||||
const { pinData } = response.body.data as { pinData: IPinData };
|
||||
|
||||
expect(pinData).toBeNull();
|
||||
});
|
||||
@@ -78,7 +78,7 @@ test('GET /workflows/:id should return pin data', async () => {
|
||||
|
||||
expect(workflowRetrievalResponse.statusCode).toBe(200);
|
||||
|
||||
const { pinData } = workflowRetrievalResponse.body.data as { pinData: PinData };
|
||||
const { pinData } = workflowRetrievalResponse.body.data as { pinData: IPinData };
|
||||
|
||||
expect(pinData).toMatchObject({ Spotify: [{ myKey: 'myValue' }] });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user