feat(core): Display conditions in displayOptions (no-changelog) (#7888)

This commit is contained in:
Michael Kret
2024-01-24 18:04:46 +02:00
committed by GitHub
parent d6deceacde
commit ed7d6b7b3a
6 changed files with 2131 additions and 63 deletions

View File

@@ -1160,7 +1160,31 @@ export type FilterTypeOptions = Partial<{
typeValidation: 'strict' | 'loose' | {}; // default = strict, `| {}` is a TypeScript trick to allow custom strings, but still give autocomplete
}>;
export type DisplayCondition =
| { _cnd: { eq: NodeParameterValue } }
| { _cnd: { not: NodeParameterValue } }
| { _cnd: { gte: number | string } }
| { _cnd: { lte: number | string } }
| { _cnd: { gt: number | string } }
| { _cnd: { lt: number | string } }
| { _cnd: { between: { from: number | string; to: number | string } } }
| { _cnd: { startsWith: string } }
| { _cnd: { endsWith: string } }
| { _cnd: { includes: string } }
| { _cnd: { regex: string } };
export interface IDisplayOptions {
hide?: {
[key: string]: Array<NodeParameterValue | DisplayCondition> | undefined;
};
show?: {
'@version'?: Array<number | DisplayCondition>;
[key: string]: Array<NodeParameterValue | DisplayCondition> | undefined;
};
hideOnCloud?: boolean;
}
export interface ICredentialsDisplayOptions {
hide?: {
[key: string]: NodeParameterValue[] | undefined;
};
@@ -1402,7 +1426,7 @@ export interface INodeCredentialTestRequest {
export interface INodeCredentialDescription {
name: string;
required?: boolean;
displayOptions?: IDisplayOptions;
displayOptions?: ICredentialsDisplayOptions;
testedBy?: ICredentialTestRequest | string; // Name of a function inside `loadOptions.credentialTest`
}