fix(cli): Fix excessive instantiation type error for flattened execution (#3921)

* 📘 Fix excessive instantiation error

* ♻️ Simplify interface for TypeORM
This commit is contained in:
Iván Ovejero 2022-08-23 15:27:04 +02:00 committed by GitHub
parent 30326d7098
commit 1d4f92a657
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 3 deletions

View file

@ -227,7 +227,7 @@ export interface IExecutionFlattedDb extends IExecutionBase {
id: number | string;
data: string;
waitTill?: Date | null;
workflowData: IWorkflowBase;
workflowData: Omit<IWorkflowBase, 'pinData'>;
}
export interface IExecutionFlattedResponse extends IExecutionFlatted {

View file

@ -2,7 +2,14 @@
/* eslint-disable import/no-cycle */
import { Length } from 'class-validator';
import { IConnections, IDataObject, INode, IPinData, IWorkflowSettings } from 'n8n-workflow';
import {
IBinaryKeyData,
IConnections,
IDataObject,
INode,
IPairedItemData,
IWorkflowSettings,
} from 'n8n-workflow';
import {
BeforeUpdate,
@ -122,10 +129,22 @@ export class WorkflowEntity implements IWorkflowDb {
nullable: true,
transformer: sqlite.jsonColumn,
})
pinData: IPinData;
pinData: ISimplifiedPinData;
@BeforeUpdate()
setUpdateDate() {
this.updatedAt = new Date();
}
}
/**
* Simplified to prevent excessively deep type instantiation error from
* `INodeExecutionData` in `IPinData` in a TypeORM entity field.
*/
export interface ISimplifiedPinData {
[nodeName: string]: Array<{
json: IDataObject;
binary?: IBinaryKeyData;
pairedItem?: IPairedItemData | IPairedItemData[] | number;
}>;
}