mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor: Fix type issues for parameter input components (#9449)
This commit is contained in:
@@ -1118,6 +1118,9 @@ export type NodeParameterValueType =
|
||||
| NodeParameterValue
|
||||
| INodeParameters
|
||||
| INodeParameterResourceLocator
|
||||
| ResourceMapperValue
|
||||
| FilterValue
|
||||
| AssignmentCollectionValue
|
||||
| NodeParameterValue[]
|
||||
| INodeParameters[]
|
||||
| INodeParameterResourceLocator[]
|
||||
@@ -2374,25 +2377,32 @@ export interface ResourceMapperField {
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
export type FieldType =
|
||||
| 'string'
|
||||
| 'string-alphanumeric'
|
||||
| 'number'
|
||||
| 'dateTime'
|
||||
| 'boolean'
|
||||
| 'time'
|
||||
| 'array'
|
||||
| 'object'
|
||||
| 'options'
|
||||
| 'url'
|
||||
| 'jwt';
|
||||
|
||||
export type ValidationResult = {
|
||||
valid: boolean;
|
||||
errorMessage?: string;
|
||||
newValue?: string | number | boolean | object | null | undefined;
|
||||
export type FieldTypeMap = {
|
||||
// eslint-disable-next-line id-denylist
|
||||
boolean: boolean;
|
||||
// eslint-disable-next-line id-denylist
|
||||
number: number;
|
||||
// eslint-disable-next-line id-denylist
|
||||
string: string;
|
||||
'string-alphanumeric': string;
|
||||
dateTime: string;
|
||||
time: string;
|
||||
array: unknown[];
|
||||
object: object;
|
||||
options: any;
|
||||
url: string;
|
||||
jwt: string;
|
||||
};
|
||||
|
||||
export type FieldType = keyof FieldTypeMap;
|
||||
|
||||
export type ValidationResult<T extends FieldType = FieldType> =
|
||||
| { valid: false; errorMessage: string }
|
||||
| {
|
||||
valid: true;
|
||||
newValue?: FieldTypeMap[T];
|
||||
};
|
||||
|
||||
export type ResourceMapperValue = {
|
||||
mappingMode: string;
|
||||
value: { [key: string]: string | number | boolean | null } | null;
|
||||
@@ -2418,9 +2428,9 @@ export interface FilterOperatorValue {
|
||||
|
||||
export type FilterConditionValue = {
|
||||
id: string;
|
||||
leftValue: unknown;
|
||||
leftValue: NodeParameterValue;
|
||||
operator: FilterOperatorValue;
|
||||
rightValue: unknown;
|
||||
rightValue: NodeParameterValue;
|
||||
};
|
||||
|
||||
export type FilterOptionsValue = {
|
||||
|
||||
Reference in New Issue
Block a user