refactor: Fix type issues for parameter input components (#9449)

This commit is contained in:
Elias Meire
2024-05-21 15:04:20 +02:00
committed by GitHub
parent cd751e7cc8
commit 711c46f205
36 changed files with 315 additions and 243 deletions

View File

@@ -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 = {