2024-08-29 06:55:53 -07:00
import {
NodeConnectionType ,
type INode ,
type INodeParameters ,
type INodeProperties ,
type INodeType ,
type INodeTypeDescription ,
2024-06-25 04:53:31 -07:00
} from '@/Interfaces' ;
import {
getNodeParameters ,
getNodeHints ,
isSingleExecution ,
isSubNodeType ,
applyDeclarativeNodeOptionParameters ,
2024-09-04 03:06:17 -07:00
convertNodeToAiTool ,
2024-06-25 04:53:31 -07:00
} from '@/NodeHelpers' ;
2024-09-18 00:19:33 -07:00
import type { Workflow } from '@/Workflow' ;
2019-06-23 03:35:23 -07:00
2022-11-09 06:25:00 -08:00
describe ( 'NodeHelpers' , ( ) = > {
2023-11-13 03:28:55 -08:00
describe ( 'getNodeParameters' , ( ) = > {
2019-06-23 03:35:23 -07:00
const tests : Array < {
description : string ;
input : {
nodePropertiesArray : INodeProperties [ ] ;
2023-11-13 03:28:55 -08:00
nodeValues : INodeParameters | null ;
2019-06-23 03:35:23 -07:00
} ;
output : {
noneDisplayedFalse : {
defaultsFalse : INodeParameters ;
defaultsTrue : INodeParameters ;
} ;
noneDisplayedTrue : {
defaultsFalse : INodeParameters ;
defaultsTrue : INodeParameters ;
} ;
} ;
} > = [
{
description : 'simple values.' ,
input : {
nodePropertiesArray : [
{
name : 'string1' ,
displayName : 'String 1' ,
type : 'string' ,
default : '' ,
} ,
{
name : 'string2' ,
displayName : 'String 2' ,
type : 'string' ,
default : 'default string 2' ,
} ,
{
name : 'string3' ,
displayName : 'String 3' ,
type : 'string' ,
default : 'default string 3' ,
} ,
{
name : 'number1' ,
displayName : 'Number 1' ,
type : 'number' ,
default : 10 ,
} ,
{
name : 'number2' ,
displayName : 'Number 2' ,
type : 'number' ,
default : 10 ,
} ,
{
name : 'number3' ,
displayName : 'Number 3' ,
type : 'number' ,
default : 10 ,
} ,
{
name : 'boolean1' ,
displayName : 'Boolean 1' ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'boolean2' ,
displayName : 'Boolean 2' ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'boolean3' ,
displayName : 'Boolean 3' ,
type : 'boolean' ,
default : true ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
name : 'boolean4' ,
displayName : 'Boolean 4' ,
type : 'boolean' ,
default : true ,
} ,
{
name : 'boolean5' ,
displayName : 'Boolean 5' ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'boolean6' ,
displayName : 'Boolean 6' ,
type : 'boolean' ,
default : true ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
boolean1 : true ,
boolean3 : false ,
boolean5 : false ,
boolean6 : true ,
string1 : 'different' ,
number1 : 1 ,
number3 : 0 ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
boolean1 : true ,
boolean3 : false ,
string1 : 'different' ,
number1 : 1 ,
number3 : 0 ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
boolean1 : true ,
boolean2 : false ,
boolean3 : false ,
boolean4 : true ,
boolean5 : false ,
boolean6 : true ,
string1 : 'different' ,
string2 : 'default string 2' ,
string3 : 'default string 3' ,
number1 : 1 ,
number2 : 10 ,
number3 : 0 ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
boolean1 : true ,
boolean3 : false ,
string1 : 'different' ,
number1 : 1 ,
number3 : 0 ,
} ,
defaultsTrue : {
boolean1 : true ,
boolean2 : false ,
boolean3 : false ,
boolean4 : true ,
boolean5 : false ,
boolean6 : true ,
string1 : 'different' ,
string2 : 'default string 2' ,
string3 : 'default string 3' ,
number1 : 1 ,
number2 : 10 ,
number3 : 0 ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'simple values with displayOptions "show" (match) which is boolean. All values set.' ,
input : {
nodePropertiesArray : [
{
name : 'boolean1' ,
displayName : 'boolean1' ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'string1' ,
displayName : 'string1' ,
displayOptions : {
show : {
boolean1 : [ true ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string1' ,
} ,
] ,
nodeValues : {
boolean1 : true ,
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
boolean1 : true ,
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
boolean1 : true ,
string1 : 'own string1' ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
boolean1 : true ,
string1 : 'own string1' ,
} ,
defaultsTrue : {
boolean1 : true ,
string1 : 'own string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'simple values with displayOptions "hide" (match) which is boolean. All values set.' ,
input : {
nodePropertiesArray : [
{
name : 'boolean1' ,
displayName : 'boolean1' ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'string1' ,
displayName : 'string1' ,
displayOptions : {
hide : {
boolean1 : [ true ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string1' ,
} ,
] ,
nodeValues : {
boolean1 : true ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
boolean1 : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
boolean1 : true ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
boolean1 : true ,
} ,
defaultsTrue : {
boolean1 : true ,
string1 : 'default string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'simple values with displayOptions "show" (match) which is boolean. One values set.' ,
input : {
nodePropertiesArray : [
{
name : 'boolean1' ,
displayName : 'boolean1' ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'string1' ,
displayName : 'string1' ,
displayOptions : {
show : {
boolean1 : [ true ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string1' ,
} ,
] ,
nodeValues : {
boolean1 : true ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
boolean1 : true ,
} ,
defaultsTrue : {
boolean1 : true ,
string1 : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
noneDisplayedTrue : {
defaultsFalse : {
boolean1 : true ,
} ,
defaultsTrue : {
boolean1 : true ,
string1 : 'default string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description : 'simple values with displayOptions "show" (match). No values set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
{
name : 'string1' ,
displayName : 'string1' ,
displayOptions : {
show : {
mode : [ 'mode1' ] ,
} ,
} ,
type : 'string' ,
default : 'default string1' ,
} ,
] ,
nodeValues : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
string1 : 'default string1' ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
string1 : 'default string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'simple values with displayOptions "show" (match) on two which depend on each other of which is boolean. One value should be displayed. One values set (none-default).' ,
input : {
nodePropertiesArray : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
} ,
{
name : 'boolean1' ,
displayName : 'boolean1' ,
displayOptions : {
show : {
2020-10-22 06:46:03 -07:00
string1 : [ 'default string1' ] ,
2019-06-23 03:35:23 -07:00
} ,
} ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'string2' ,
displayName : 'string2' ,
displayOptions : {
show : {
boolean1 : [ true ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string2' ,
} ,
] ,
nodeValues : {
boolean1 : true ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
boolean1 : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
string1 : 'default string1' ,
boolean1 : true ,
string2 : 'default string2' ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
boolean1 : true ,
} ,
defaultsTrue : {
string1 : 'default string1' ,
boolean1 : true ,
string2 : 'default string2' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'simple values with displayOptions "show" (match) on two which depend on each other of which is boolean. One value should be displayed. One values set. (default)' ,
input : {
nodePropertiesArray : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
} ,
{
name : 'boolean1' ,
displayName : 'boolean1' ,
displayOptions : {
show : {
2020-10-22 06:46:03 -07:00
string1 : [ 'default string1' ] ,
2019-06-23 03:35:23 -07:00
} ,
} ,
type : 'boolean' ,
default : false ,
} ,
{
name : 'string2' ,
displayName : 'string2' ,
displayOptions : {
show : {
boolean1 : [ true ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string2' ,
} ,
] ,
nodeValues : {
boolean1 : false ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : { } ,
defaultsTrue : {
string1 : 'default string1' ,
boolean1 : false ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : { } ,
defaultsTrue : {
string1 : 'default string1' ,
boolean1 : false ,
string2 : 'default string2' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description : 'simple values with displayOptions "show" (match). All values set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
{
name : 'string1' ,
displayName : 'string1' ,
displayOptions : {
show : {
mode : [ 'mode1' ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string1' ,
} ,
] ,
nodeValues : {
mode : 'mode1' ,
string1 : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
string1 : 'default string1' ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
string1 : 'default string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description : 'simple values with displayOptions "show" (no-match). No values set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
{
name : 'string1' ,
displayName : 'string1' ,
displayOptions : {
show : {
mode : [ 'mode2' ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string1' ,
} ,
] ,
nodeValues : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
string1 : 'default string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description : 'simple values with displayOptions "show" (no-match). All values set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
{
name : 'string1' ,
displayName : 'string1' ,
displayOptions : {
show : {
mode : [ 'mode2' ] ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
type : 'string' ,
default : 'default string1' ,
} ,
] ,
nodeValues : {
mode : 'mode1' ,
string1 : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
string1 : 'default string1' ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
{
2019-06-23 03:35:23 -07:00
description : 'complex type "fixedCollection" with "multipleValues: true". One value set.' ,
input : {
nodePropertiesArray : [
{
name : 'values' ,
displayName : 'Values' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
default : { } ,
options : [
{
name : 'boolean' ,
displayName : 'Boolean' ,
values : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
name : 'boolean1' ,
displayName : 'boolean1' ,
type : 'boolean' ,
default : false ,
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
2019-06-23 03:35:23 -07:00
{
name : 'number' ,
displayName : 'Number' ,
values : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
displayName : 'number1' ,
name : 'number1' ,
type : 'number' ,
default : 0 ,
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
values : {
number : [
{
number1 : 1 ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
number : [
{
number1 : 1 ,
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
values : {
number : [
{
string1 : 'default string1' ,
number1 : 1 ,
} ,
] ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
number1 : 1 ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
values : {
number : [
{
string1 : 'default string1' ,
number1 : 1 ,
} ,
] ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
{
description : 'complex type "fixedCollection" with "multipleValues: false". One value set.' ,
input : {
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
displayName : 'Values' ,
name : 'values' ,
type : 'fixedCollection' ,
default : { } ,
options : [
{
name : 'boolean' ,
displayName : 'Boolean' ,
values : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
} ,
{
name : 'boolean1' ,
displayName : 'boolean1' ,
type : 'boolean' ,
default : false ,
} ,
] ,
} ,
{
name : 'number' ,
displayName : 'Number' ,
values : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
displayName : 'number1' ,
2020-10-22 06:46:03 -07:00
name : 'number1' ,
2019-06-23 03:35:23 -07:00
type : 'number' ,
default : 0 ,
} ,
] ,
} ,
{
name : 'singleString' ,
displayName : 'Single String' ,
values : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default singleString1' ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
values : {
number : {
number1 : 1 ,
} ,
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
number : {
number1 : 1 ,
} ,
} ,
} ,
defaultsTrue : {
values : {
number : {
string1 : 'default string1' ,
number1 : 1 ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : {
number1 : 1 ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
values : {
number : {
string1 : 'default string1' ,
number1 : 1 ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
2019-06-23 03:35:23 -07:00
{
description :
'complex type "fixedCollection" with "multipleValues: false". Two values set one single one.' ,
2021-08-29 11:58:11 -07:00
input : {
2019-06-23 03:35:23 -07:00
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
displayName : 'Values' ,
name : 'values' ,
type : 'fixedCollection' ,
default : { } ,
options : [
{
name : 'boolean' ,
displayName : 'Boolean' ,
values : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
name : 'boolean1' ,
displayName : 'boolean1' ,
type : 'boolean' ,
default : false ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'number' ,
displayName : 'Number' ,
values : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
displayName : 'number1' ,
name : 'number1' ,
type : 'number' ,
default : 0 ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
{
2019-06-23 03:35:23 -07:00
name : 'singleString' ,
displayName : 'Single String' ,
values : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default singleString1' ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
values : {
number : {
number1 : 1 ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
singleString : {
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
number : {
number1 : 1 ,
} ,
singleString : {
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
} ,
2019-06-23 03:35:23 -07:00
} ,
} ,
defaultsTrue : {
values : {
number : {
2020-10-22 06:46:03 -07:00
string1 : 'default string1' ,
2019-06-23 03:35:23 -07:00
number1 : 1 ,
} ,
singleString : {
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : {
number1 : 1 ,
} ,
singleString : {
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
} ,
} ,
defaultsTrue : {
values : {
number : {
string1 : 'default string1' ,
number1 : 1 ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
singleString : {
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
{
2019-06-23 03:35:23 -07:00
description :
'complex type "fixedCollection" with "multipleValues: true" and complex type "collection" with "multipleValues: true". One value set each.' ,
input : {
nodePropertiesArray : [
{
displayName : 'Values' ,
name : 'values' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
description : 'The value to set.' ,
default : { } ,
options : [
{
name : 'boolean' ,
displayName : 'Boolean' ,
values : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
2020-10-22 06:46:03 -07:00
default : 'default string1' ,
} ,
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'boolean1' ,
displayName : 'boolean1' ,
type : 'boolean' ,
default : false ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'number' ,
displayName : 'Number' ,
values : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
name : 'number1' ,
displayName : 'number1' ,
type : 'number' ,
default : 0 ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
name : 'collection1' ,
displayName : 'collection1' ,
type : 'collection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
default : 'default string1' ,
} ,
{
name : 'string2' ,
displayName : 'string2' ,
type : 'string' ,
2020-10-22 06:46:03 -07:00
default : 'default string2' ,
} ,
2019-06-23 03:35:23 -07:00
] ,
} ,
] ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
values : {
number : [
{
number1 : 1 ,
collection1 : [
{
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
] ,
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
number : [
{
number1 : 1 ,
collection1 : [
{
string1 : 'value1' ,
} ,
] ,
} ,
] ,
} ,
} ,
defaultsTrue : {
values : {
number : [
{
string1 : 'default string1' ,
number1 : 1 ,
collection1 : [
2021-08-29 11:58:11 -07:00
{
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : [
{
number1 : 1 ,
collection1 : [
2021-08-29 11:58:11 -07:00
{
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
} ,
defaultsTrue : {
values : {
number : [
{
string1 : 'default string1' ,
number1 : 1 ,
collection1 : [
{
string1 : 'value1' ,
} ,
] ,
} ,
] ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
{
description :
'complex type "fixedCollection" with "multipleValues: false" and with displayOptions "show" (match) on option. One value set.' ,
input : {
nodePropertiesArray : [
{
name : 'values' ,
displayName : 'Values' ,
type : 'fixedCollection' ,
default : { } ,
options : [
{
name : 'number' ,
displayName : 'Number' ,
values : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2019-06-23 03:35:23 -07:00
mode : [ 'mode1' ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
name : 'number1' ,
displayName : 'number1' ,
type : 'number' ,
default : 0 ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
values : {
number : {
number1 : 1 ,
} ,
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
number : {
number1 : 1 ,
} ,
} ,
} ,
defaultsTrue : {
values : {
number : {
mode : 'mode1' ,
string1 : 'default string1' ,
number1 : 1 ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : {
number1 : 1 ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
values : {
number : {
mode : 'mode1' ,
string1 : 'default string1' ,
number1 : 1 ,
} ,
} ,
} ,
} ,
} ,
} ,
{
description :
'complex type "fixedCollection" with "multipleValues: false" and with displayOptions "show" (match) on option which references root-value. One value set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
{
name : 'values' ,
displayName : 'Values' ,
type : 'fixedCollection' ,
default : { } ,
options : [
{
name : 'number' ,
displayName : 'Number' ,
values : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
displayOptions : {
show : {
'/mode' : [ 'mode1' ] ,
} ,
} ,
default : 'default string1' ,
} ,
{
name : 'number1' ,
displayName : 'number1' ,
type : 'number' ,
default : 0 ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
] ,
nodeValues : {
values : {
number : {
string1 : 'own string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
number : {
string1 : 'own string1' ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
mode : 'mode1' ,
values : {
number : {
string1 : 'own string1' ,
number1 : 0 ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : {
string1 : 'own string1' ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
mode : 'mode1' ,
values : {
number : {
string1 : 'own string1' ,
number1 : 0 ,
} ,
} ,
} ,
} ,
} ,
} ,
{
description :
'complex type "fixedCollection" with "multipleValues: false" and with displayOptions "show" (no-match) on option which references root-value. One value set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
{
name : 'values' ,
displayName : 'Values' ,
type : 'fixedCollection' ,
default : { } ,
options : [
{
name : 'number' ,
displayName : 'Number' ,
values : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
displayOptions : {
show : {
'/mode' : [ 'mode2' ] ,
} ,
} ,
default : 'default string1' ,
} ,
{
name : 'number1' ,
displayName : 'number1' ,
type : 'number' ,
default : 0 ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
] ,
nodeValues : {
values : {
number : {
string1 : 'own string1' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : { } ,
defaultsTrue : {
mode : 'mode1' ,
values : {
number : {
number1 : 0 ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : {
string1 : 'own string1' ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
mode : 'mode1' ,
values : {
number : {
string1 : 'own string1' ,
number1 : 0 ,
} ,
} ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
// Remember it is correct that default strings get returned here even when returnDefaults
// is set to false because if they would not, there would be no way to know which value
// got added and which one not.
{
description :
'complex type "collection" with "multipleValues: false" and with displayOptions "show" (match) on option which references root-value. One value set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
{
name : 'values' ,
displayName : 'Values' ,
type : 'collection' ,
default : { } ,
options : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
displayOptions : {
show : {
'/mode' : [ 'mode1' ] ,
} ,
} ,
default : 'default string1' ,
} ,
{
name : 'number1' ,
displayName : 'number1' ,
type : 'number' ,
default : 0 ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
values : {
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
string1 : 'own string1' ,
} ,
} ,
defaultsTrue : {
mode : 'mode1' ,
values : {
string1 : 'own string1' ,
} ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
values : {
string1 : 'own string1' ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
mode : 'mode1' ,
values : {
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
} ,
} ,
2019-06-23 03:35:23 -07:00
// Remember it is correct that default strings get returned here even when returnDefaults
// is set to false because if they would not, there would be no way to know which value
// got added and which one not.
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
description :
'complex type "collection" with "multipleValues: false" and with displayOptions "show" (no-match) on option which references root-value. One value set.' ,
2021-08-29 11:58:11 -07:00
input : {
2019-06-23 03:35:23 -07:00
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
name : 'values' ,
displayName : 'Values' ,
type : 'collection' ,
default : { } ,
options : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
displayOptions : {
show : {
'/mode' : [ 'mode2' ] ,
} ,
} ,
default : 'default string1' ,
} ,
{
name : 'number1' ,
displayName : 'number1' ,
type : 'number' ,
default : 0 ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
values : {
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
// TODO: Write some code which cleans up data like that
values : { } ,
} ,
defaultsTrue : {
mode : 'mode1' ,
values : { } ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
values : {
string1 : 'own string1' ,
} ,
} ,
defaultsTrue : {
mode : 'mode1' ,
values : {
string1 : 'own string1' ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
2019-06-23 03:35:23 -07:00
// Remember it is correct that default strings get returned here even when returnDefaults
// is set to false because if they would not, there would be no way to know which value
// got added and which one not.
{
description :
'complex type "collection" with "multipleValues: true" and with displayOptions "show" (match) on option which references root-value. One value set.' ,
input : {
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
name : 'values' ,
displayName : 'Values' ,
type : 'collection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
displayOptions : {
show : {
'/mode' : [ 'mode1' ] ,
} ,
} ,
default : 'default string1' ,
} ,
{
name : 'number1' ,
displayName : 'number1' ,
type : 'number' ,
default : 0 ,
} ,
] ,
} ,
] ,
nodeValues : {
values : [
{
string1 : 'own string1' ,
} ,
] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : [
{
2020-10-22 06:46:03 -07:00
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
2020-10-22 06:46:03 -07:00
mode : 'mode1' ,
values : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
string1 : 'own string1' ,
2020-10-22 06:46:03 -07:00
} ,
2019-06-23 03:35:23 -07:00
] ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
2020-10-22 06:46:03 -07:00
values : [
2019-06-23 03:35:23 -07:00
{
2020-10-22 06:46:03 -07:00
string1 : 'own string1' ,
} ,
2019-06-23 03:35:23 -07:00
] ,
} ,
defaultsTrue : {
mode : 'mode1' ,
2020-10-22 06:46:03 -07:00
values : [
2021-08-29 11:58:11 -07:00
{
2020-10-22 06:46:03 -07:00
string1 : 'own string1' ,
} ,
2019-06-23 03:35:23 -07:00
] ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
// Remember it is correct that default strings get returned here even when returnDefaults
// is set to false because if they would not, there would be no way to know which value
// got added and which one not.
{
description :
'complex type "collection" with "multipleValues: true" and with displayOptions "show" (no-match) on option which references root-value. One value set.' ,
input : {
nodePropertiesArray : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
name : 'values' ,
displayName : 'Values' ,
type : 'collection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'string1' ,
displayName : 'string1' ,
type : 'string' ,
displayOptions : {
show : {
'/mode' : [ 'mode2' ] ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
} ,
default : 'default string1' ,
} ,
{
2020-10-22 06:46:03 -07:00
name : 'number1' ,
2019-06-23 03:35:23 -07:00
displayName : 'number1' ,
type : 'number' ,
2020-10-22 06:46:03 -07:00
default : 0 ,
} ,
2019-06-23 03:35:23 -07:00
] ,
} ,
] ,
nodeValues : {
values : [
{
string1 : 'own string1' ,
number1 : 0 ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : [
{
string1 : 'own string1' ,
number1 : 0 ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
defaultsTrue : {
mode : 'mode1' ,
values : [
{
string1 : 'own string1' ,
number1 : 0 ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : [
{
string1 : 'own string1' ,
number1 : 0 ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
defaultsTrue : {
mode : 'mode1' ,
values : [
{
string1 : 'own string1' ,
number1 : 0 ,
} ,
] ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'complex type "fixedCollection" with "multipleValues: false" and with displayOptions "show" (no-match) on option. One value set also the not displayed one.' ,
input : {
nodePropertiesArray : [
{
name : 'values' ,
displayName : 'Values' ,
type : 'fixedCollection' ,
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
name : 'number' ,
displayName : 'Number' ,
values : [
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2019-06-23 03:35:23 -07:00
mode : [ 'mode1' ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
default : 'default string1' ,
} ,
{
displayName : 'number1' ,
name : 'number1' ,
type : 'number' ,
default : 0 ,
} ,
] ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-06-23 03:35:23 -07:00
} ,
] ,
nodeValues : {
values : {
number : {
mode : 'mode2' ,
string1 : 'default string1' ,
number1 : 1 ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
number : {
mode : 'mode2' ,
number1 : 1 ,
} ,
} ,
} ,
defaultsTrue : {
values : {
number : {
mode : 'mode2' ,
number1 : 1 ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
number : {
mode : 'mode2' ,
number1 : 1 ,
} ,
} ,
} ,
defaultsTrue : {
values : {
number : {
mode : 'mode2' ,
string1 : 'default string1' ,
number1 : 1 ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'complex type "collection" with "multipleValues: true". One none-default value set.' ,
input : {
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
displayName : 'collection1' ,
name : 'collection1' ,
type : 'collection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
displayName : 'string2' ,
name : 'string2' ,
type : 'string' ,
default : 'default string2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
collection1 : [
{
string1 : 'value1' ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
collection1 : [
{
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
defaultsTrue : {
collection1 : [
{
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
collection1 : [
{
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
defaultsTrue : {
collection1 : [
{
2020-10-22 06:46:03 -07:00
string1 : 'value1' ,
2019-06-23 03:35:23 -07:00
} ,
] ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
// Remember it is correct that default strings get returned here even when returnDefaults
// is set to false because if they would not, there would be no way to know which value
// got added and which one not.
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
description :
'complex type "collection" with "multipleValues: true". One default value set.' ,
input : {
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
displayName : 'collection1' ,
name : 'collection1' ,
type : 'collection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
displayName : 'string2' ,
name : 'string2' ,
type : 'string' ,
default : 'default string2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
collection1 : [
{
string1 : 'default string1' ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
collection1 : [
{
string1 : 'default string1' ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
defaultsTrue : {
collection1 : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
string1 : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
collection1 : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
string1 : 'default string1' ,
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
collection1 : [
{
string1 : 'default string1' ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-06-23 03:35:23 -07:00
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
{
description :
'complex type "collection" with "multipleValues: false". One none-default value set.' ,
input : {
nodePropertiesArray : [
{
displayName : 'collection1' ,
name : 'collection1' ,
type : 'collection' ,
2021-05-19 16:44:27 -07:00
default : { } ,
2019-06-23 03:35:23 -07:00
options : [
{
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
default : 'default string1' ,
} ,
{
displayName : 'string2' ,
name : 'string2' ,
type : 'string' ,
default : 'default string2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
collection1 : {
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
collection1 : {
string1 : 'own string1' ,
} ,
} ,
defaultsTrue : {
collection1 : {
string1 : 'own string1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
} ,
noneDisplayedTrue : {
2021-05-19 16:44:27 -07:00
defaultsFalse : {
2019-06-23 03:35:23 -07:00
collection1 : {
string1 : 'own string1' ,
} ,
} ,
defaultsTrue : {
collection1 : {
string1 : 'own string1' ,
} ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-12 11:58:52 -07:00
{
description :
'complex type "collection" with "multipleValues: false". One default value set.' ,
input : {
nodePropertiesArray : [
{
displayName : 'collection1' ,
name : 'collection1' ,
type : 'collection' ,
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-12 11:58:52 -07:00
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
default : 'default string1' ,
} ,
{
displayName : 'string2' ,
name : 'string2' ,
type : 'string' ,
default : 'default string2' ,
} ,
] ,
} ,
] ,
nodeValues : {
2019-06-23 03:35:23 -07:00
collection1 : {
string1 : 'default string1' ,
2019-07-12 11:58:52 -07:00
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-12 11:58:52 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
2019-06-23 03:35:23 -07:00
collection1 : {
string1 : 'default string1' ,
2019-07-12 11:58:52 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-12 11:58:52 -07:00
defaultsTrue : {
collection1 : {
string1 : 'default string1' ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-12 11:58:52 -07:00
noneDisplayedTrue : {
defaultsFalse : {
2019-06-23 03:35:23 -07:00
collection1 : {
string1 : 'default string1' ,
2019-07-12 11:58:52 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-12 11:58:52 -07:00
defaultsTrue : {
collection1 : {
string1 : 'default string1' ,
} ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
{
description :
'complex type "collection" with "multipleValues: false". Only outer value set.' ,
input : {
nodePropertiesArray : [
{
displayName : 'collection1' ,
name : 'collection1' ,
type : 'collection' ,
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
default : 'default string1' ,
} ,
{
displayName : 'string2' ,
name : 'string2' ,
type : 'string' ,
default : 'default string2' ,
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : {
collection1 : { } ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
collection1 : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
collection1 : { } ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
defaultsFalse : {
collection1 : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
collection1 : { } ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
} ,
{
2019-06-23 03:35:23 -07:00
description : 'complex type "collection" with "multipleValues: false". No value set at all.' ,
2021-08-29 11:58:11 -07:00
input : {
2019-06-23 03:35:23 -07:00
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-06-23 03:35:23 -07:00
displayName : 'collection1' ,
name : 'collection1' ,
type : 'collection' ,
default : { } ,
2019-07-13 10:50:41 -07:00
options : [
{
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
2019-06-23 03:35:23 -07:00
default : 'default string1' ,
2019-07-13 10:50:41 -07:00
} ,
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'string2' ,
2019-06-23 03:35:23 -07:00
name : 'string2' ,
type : 'string' ,
2019-07-13 10:50:41 -07:00
default : 'default string2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
] ,
2019-06-23 03:35:23 -07:00
nodeValues : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
2019-07-13 10:50:41 -07:00
collection1 : { } ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
noneDisplayedTrue : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
collection1 : { } ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
} ,
{
2019-07-13 10:50:41 -07:00
description : 'complex type "collection" with "multipleValues: true". No value set at all.' ,
2021-08-29 11:58:11 -07:00
input : {
2019-07-13 10:50:41 -07:00
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'collection1' ,
2019-06-23 03:35:23 -07:00
name : 'collection1' ,
type : 'collection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2021-05-19 16:07:26 -07:00
default : [ ] ,
2019-06-23 03:35:23 -07:00
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'string1' ,
name : 'string1' ,
type : 'string' ,
2019-06-23 03:35:23 -07:00
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-06-23 03:35:23 -07:00
displayName : 'string2' ,
name : 'string2' ,
type : 'string' ,
default : 'default string2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
] ,
2019-07-13 10:50:41 -07:00
nodeValues : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
noneDisplayedFalse : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
collection1 : [ ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
collection1 : [ ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
} ,
{
2019-06-23 03:35:23 -07:00
description :
2019-07-13 10:50:41 -07:00
'two identically named properties of which only one gets displayed with different options. No value set at all.' ,
2021-08-29 11:58:11 -07:00
input : {
2019-06-23 03:35:23 -07:00
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'mainOption' ,
2019-07-12 11:58:52 -07:00
name : 'mainOption' ,
type : 'options' ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
name : 'option1' ,
2019-07-12 11:58:52 -07:00
value : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-12 11:58:52 -07:00
name : 'option2' ,
2019-07-13 10:50:41 -07:00
value : 'option2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
displayOptions : {
show : {
mainOption : [ 'option1' ] ,
} ,
} ,
2019-07-12 11:58:52 -07:00
options : [
2019-07-13 10:50:41 -07:00
{
name : 'option1a' ,
2019-07-12 11:58:52 -07:00
value : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-12 11:58:52 -07:00
name : 'option1b' ,
value : 'option1b' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
displayOptions : {
show : {
mainOption : [ 'option2' ] ,
} ,
} ,
2019-07-12 11:58:52 -07:00
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-12 11:58:52 -07:00
name : 'option2a' ,
value : 'option2a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-12 11:58:52 -07:00
name : 'option2b' ,
value : 'option2b' ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
] ,
2019-07-12 11:58:52 -07:00
default : 'option2a' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
nodeValues : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
2019-07-13 10:50:41 -07:00
noneDisplayedFalse : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
2019-07-13 10:50:41 -07:00
mainOption : 'option1' ,
2019-07-12 11:58:52 -07:00
subOption : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
2019-07-13 10:50:41 -07:00
mainOption : 'option1' ,
2019-07-12 11:58:52 -07:00
subOption : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-07-13 10:50:41 -07:00
{
description :
2022-09-02 07:13:17 -07:00
'One property which is dependency on two identically named properties of which only one gets displayed with different options. No value set at all.' ,
2019-07-13 10:50:41 -07:00
input : {
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'mainOption' ,
2019-07-12 11:58:52 -07:00
name : 'mainOption' ,
2019-07-13 10:50:41 -07:00
type : 'options' ,
2019-07-12 11:58:52 -07:00
options : [
2019-07-13 10:50:41 -07:00
{
name : 'option1' ,
value : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-12 11:58:52 -07:00
name : 'option2' ,
2019-07-13 10:50:41 -07:00
value : 'option2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
2019-07-12 11:58:52 -07:00
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2019-07-13 10:50:41 -07:00
mainOption : [ 'option1' ] ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
} ,
2019-07-12 11:58:52 -07:00
options : [
2019-07-13 10:50:41 -07:00
{
2019-07-12 11:58:52 -07:00
name : 'option1a' ,
2019-07-13 10:50:41 -07:00
value : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-12 11:58:52 -07:00
name : 'option1b' ,
value : 'option1b' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2019-07-13 10:50:41 -07:00
mainOption : [ 'option2' ] ,
} ,
} ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-12 11:58:52 -07:00
name : 'option2a' ,
value : 'option2a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-12 11:58:52 -07:00
name : 'option2b' ,
value : 'option2b' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-12 11:58:52 -07:00
default : 'option2a' ,
2019-07-13 10:50:41 -07:00
} ,
{
displayName : 'dependentParameter' ,
name : 'dependentParameter' ,
type : 'string' ,
default : 'value1' ,
required : true ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2019-07-13 10:50:41 -07:00
mainOption : [ 'option1' ] ,
2019-07-12 11:58:52 -07:00
subOption : [ 'option1a' ] ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
{
displayName : 'dependentParameter' ,
name : 'dependentParameter' ,
type : 'string' ,
default : 'value2' ,
required : true ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2020-10-22 06:46:03 -07:00
mainOption : [ 'option2' ] ,
2019-07-13 10:50:41 -07:00
subOption : [ 'option2a' ] ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
} ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-07-13 10:50:41 -07:00
nodeValues : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-06-23 03:35:23 -07:00
output : {
2019-07-13 10:50:41 -07:00
noneDisplayedFalse : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
2019-07-13 10:50:41 -07:00
mainOption : 'option1' ,
2019-07-12 11:58:52 -07:00
subOption : 'option1a' ,
2019-07-13 10:50:41 -07:00
dependentParameter : 'value1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-06-23 03:35:23 -07:00
noneDisplayedTrue : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-06-23 03:35:23 -07:00
defaultsTrue : {
2019-07-13 10:50:41 -07:00
mainOption : 'option1' ,
subOption : 'option1a' ,
dependentParameter : 'value1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
{
description :
2022-09-02 07:13:17 -07:00
'One property which is dependency on two identically named properties of which only one gets displayed with different options. No value set at all. Order reversed' ,
2019-07-13 10:50:41 -07:00
input : {
nodePropertiesArray : [
{
displayName : 'dependentParameter' ,
name : 'dependentParameter' ,
type : 'string' ,
default : 'value2' ,
required : true ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2020-10-22 06:46:03 -07:00
mainOption : [ 'option2' ] ,
2019-07-13 10:50:41 -07:00
subOption : [ 'option2a' ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
displayOptions : {
show : {
2020-10-22 06:46:03 -07:00
mainOption : [ 'option2' ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-07-13 10:50:41 -07:00
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
name : 'option2a' ,
value : 'option2a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
name : 'option2b' ,
value : 'option2b' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option2a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2019-07-13 10:50:41 -07:00
mainOption : [ 'option1' ] ,
} ,
} ,
options : [
{
name : 'option1a' ,
value : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
name : 'option1b' ,
value : 'option1b' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'dependentParameter' ,
name : 'dependentParameter' ,
type : 'string' ,
default : 'value1' ,
required : true ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2019-07-13 10:50:41 -07:00
mainOption : [ 'option1' ] ,
subOption : [ 'option1a' ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'mainOption' ,
name : 'mainOption' ,
type : 'options' ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
name : 'option1' ,
value : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
name : 'option2' ,
value : 'option2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
nodeValues : { } ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
output : {
noneDisplayedFalse : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-07-13 10:50:41 -07:00
defaultsTrue : {
mainOption : 'option1' ,
subOption : 'option1a' ,
dependentParameter : 'value1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-07-13 10:50:41 -07:00
noneDisplayedTrue : {
2021-05-19 16:44:27 -07:00
defaultsFalse : { } ,
2019-07-13 10:50:41 -07:00
defaultsTrue : {
mainOption : 'option1' ,
subOption : 'option1a' ,
dependentParameter : 'value1' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
} ,
{
2019-07-13 10:50:41 -07:00
description :
2022-09-02 07:13:17 -07:00
'One property which is dependency on two identically named properties of which only one gets displayed with different options. No value set at all.' ,
2021-08-29 11:58:11 -07:00
input : {
2019-07-13 10:50:41 -07:00
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'mainOption' ,
name : 'mainOption' ,
type : 'options' ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
name : 'option1' ,
value : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
name : 'option2' ,
value : 'option2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
displayOptions : {
show : {
mainOption : [ 'option1' ] ,
} ,
} ,
options : [
{
name : 'option1a' ,
value : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
name : 'option1b' ,
value : 'option1b' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option1a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'subOption' ,
name : 'subOption' ,
type : 'options' ,
displayOptions : {
show : {
mainOption : [ 'option2' ] ,
} ,
} ,
options : [
{
name : 'option2a' ,
value : 'option2a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
name : 'option2b' ,
value : 'option2b' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-07-13 10:50:41 -07:00
default : 'option2a' ,
2021-08-29 11:58:11 -07:00
} ,
{
2019-07-13 10:50:41 -07:00
displayName : 'dependentParameter' ,
name : 'dependentParameter' ,
type : 'string' ,
default : 'value1' ,
required : true ,
displayOptions : {
show : {
mainOption : [ 'option1' ] ,
subOption : [ 'option1a' ] ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
{
displayName : 'dependentParameter' ,
name : 'dependentParameter' ,
type : 'string' ,
default : 'value2' ,
required : true ,
displayOptions : {
2021-08-29 11:58:11 -07:00
show : {
2020-10-22 06:46:03 -07:00
mainOption : [ 'option2' ] ,
2019-07-13 10:50:41 -07:00
subOption : [ 'option2a' ] ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
] ,
nodeValues : {
2020-10-22 06:46:03 -07:00
mainOption : 'option2' ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-07-13 10:50:41 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
2020-10-22 06:46:03 -07:00
mainOption : 'option2' ,
2019-07-13 10:50:41 -07:00
} ,
defaultsTrue : {
2020-10-22 06:46:03 -07:00
mainOption : 'option2' ,
2019-07-13 10:50:41 -07:00
subOption : 'option2a' ,
dependentParameter : 'value2' ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
} ,
noneDisplayedTrue : {
defaultsFalse : {
mainOption : 'option2' ,
} ,
defaultsTrue : {
mainOption : 'option2' ,
subOption : 'option2a' ,
dependentParameter : 'value2' ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
{
description :
'complex type "fixedCollection" with "multipleValues: true". Which contains complex type "fixedCollection" with "multipleValues: true". One value set.' ,
input : {
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2019-10-04 03:33:23 -07:00
displayName : 'Values1' ,
name : 'values1' ,
type : 'fixedCollection' ,
2019-07-13 10:50:41 -07:00
typeOptions : {
2019-10-04 03:33:23 -07:00
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-10-04 03:33:23 -07:00
description : 'The value to set.' ,
default : { } ,
2019-07-13 10:50:41 -07:00
options : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
displayName : 'Options1' ,
name : 'options1' ,
2019-10-04 03:33:23 -07:00
values : [
2021-08-29 11:58:11 -07:00
{
2019-10-04 03:33:23 -07:00
displayName : 'Values2' ,
name : 'values2' ,
2019-07-13 10:50:41 -07:00
type : 'fixedCollection' ,
typeOptions : {
2019-10-04 03:33:23 -07:00
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
description : 'The value to set.' ,
default : { } ,
options : [
{
displayName : 'Options2' ,
name : 'options2' ,
2019-10-04 03:33:23 -07:00
values : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
name : 'string1' ,
2019-10-04 03:33:23 -07:00
displayName : 'string1' ,
2019-07-13 10:50:41 -07:00
type : 'string' ,
2019-10-04 03:33:23 -07:00
default : 'default string1' ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
{
2019-10-04 03:33:23 -07:00
name : 'number1' ,
2019-07-13 10:50:41 -07:00
displayName : 'number1' ,
2019-10-04 03:33:23 -07:00
type : 'number' ,
default : 0 ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
2019-07-13 10:50:41 -07:00
nodeValues : {
2019-10-04 03:33:23 -07:00
values1 : {
2019-07-13 10:50:41 -07:00
options1 : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
values2 : {
options2 : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
number1 : 1 ,
2021-08-29 11:58:11 -07:00
} ,
2019-07-13 10:50:41 -07:00
] ,
} ,
} ,
2021-08-29 11:58:11 -07:00
] ,
} ,
} ,
} ,
2019-07-13 10:50:41 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
2019-10-04 03:33:23 -07:00
values1 : {
2019-07-13 10:50:41 -07:00
options1 : [
{
values2 : {
options2 : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
number1 : 1 ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
2019-07-13 10:50:41 -07:00
} ,
] ,
} ,
} ,
defaultsTrue : {
values1 : {
options1 : [
{
values2 : {
options2 : [
2021-08-29 11:58:11 -07:00
{
2019-07-13 10:50:41 -07:00
string1 : 'default string1' ,
2019-10-04 03:33:23 -07:00
number1 : 1 ,
2021-08-29 11:58:11 -07:00
} ,
] ,
} ,
2019-07-13 10:50:41 -07:00
} ,
] ,
} ,
} ,
} ,
2021-05-15 15:51:14 -07:00
noneDisplayedTrue : {
2019-10-04 03:33:23 -07:00
defaultsFalse : {
values1 : {
options1 : [
{
values2 : {
options2 : [
{
number1 : 1 ,
} ,
] ,
} ,
} ,
] ,
} ,
} ,
defaultsTrue : {
values1 : {
options1 : [
{
values2 : {
options2 : [
{
string1 : 'default string1' ,
number1 : 1 ,
} ,
] ,
} ,
} ,
] ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2019-10-04 03:33:23 -07:00
{
description :
'complex type "fixedCollection" with "multipleValues: true". Which contains parameters which get displayed on a parameter with a default expression with relative parameter references.' ,
input : {
nodePropertiesArray : [
{
displayName : 'Values1' ,
name : 'values1' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2019-10-04 03:33:23 -07:00
description : 'The value to set.' ,
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2019-10-04 03:33:23 -07:00
displayName : 'Options1' ,
name : 'options1' ,
values : [
{
displayName : 'Key' ,
name : 'key' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Type' ,
2021-05-15 15:51:14 -07:00
name : 'type' ,
type : 'hidden' ,
2019-10-04 03:33:23 -07:00
default : '={{$parameter["&key"].split("|")[1]}}' ,
} ,
{
displayName : 'Title Value' ,
2021-05-15 15:51:14 -07:00
name : 'titleValue' ,
2019-10-04 03:33:23 -07:00
displayOptions : {
show : {
type : [ 'title' ] ,
} ,
} ,
type : 'string' ,
2021-05-15 15:51:14 -07:00
default : 'defaultTitle' ,
2019-10-04 03:33:23 -07:00
} ,
{
2021-05-15 15:51:14 -07:00
displayName : 'Title Number' ,
2019-10-04 03:33:23 -07:00
name : 'numberValue' ,
displayOptions : {
show : {
type : [ 'number' ] ,
} ,
} ,
type : 'number' ,
2021-05-15 15:51:14 -07:00
default : 1 ,
2019-10-04 03:33:23 -07:00
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2019-10-04 03:33:23 -07:00
} ,
2021-08-29 11:58:11 -07:00
] ,
2021-05-15 15:51:14 -07:00
nodeValues : {
2019-10-04 03:33:23 -07:00
values1 : {
options1 : [
2021-08-29 11:58:11 -07:00
{
2021-05-15 15:51:14 -07:00
key : 'asdf|title' ,
titleValue : 'different' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2019-10-04 03:33:23 -07:00
} ,
} ,
} ,
2021-05-15 15:51:14 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
2019-10-04 03:33:23 -07:00
values1 : {
2021-05-15 15:51:14 -07:00
options1 : [
{
key : 'asdf|title' ,
titleValue : 'different' ,
} ,
] ,
} ,
} ,
defaultsTrue : {
values1 : {
options1 : [
{
key : 'asdf|title' ,
type : '={{$parameter["&key"].split("|")[1]}}' ,
// This is not great that it displays this theoretically hidden parameter
// but because we can not resolve the values for now
numberValue : 1 ,
titleValue : 'different' ,
} ,
] ,
} ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
values1 : {
options1 : [
{
key : 'asdf|title' ,
titleValue : 'different' ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2021-05-15 15:51:14 -07:00
defaultsTrue : {
values1 : {
options1 : [
{
key : 'asdf|title' ,
type : '={{$parameter["&key"].split("|")[1]}}' ,
titleValue : 'different' ,
numberValue : 1 ,
} ,
] ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
} ,
2021-05-15 15:51:14 -07:00
{
description :
'complex type "fixedCollection" with "multipleValues: true". Which contains parameter of type "multiOptions" and has so an array default value' ,
2021-08-29 11:58:11 -07:00
input : {
2021-05-15 15:51:14 -07:00
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2021-05-19 16:07:26 -07:00
name : 'values' ,
2021-05-15 15:51:14 -07:00
displayName : 'Values' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2021-05-15 15:51:14 -07:00
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2021-05-19 16:07:26 -07:00
name : 'propertyValues' ,
displayName : 'Property' ,
2021-05-15 15:51:14 -07:00
values : [
{
displayName : 'Options' ,
name : 'multiSelectValue' ,
type : 'multiOptions' ,
2021-05-19 16:07:26 -07:00
options : [
2021-08-29 11:58:11 -07:00
{
2021-05-19 16:07:26 -07:00
name : 'Value1' ,
value : 'value1' ,
2021-08-29 11:58:11 -07:00
} ,
{
2021-05-19 16:07:26 -07:00
name : 'Value2' ,
value : 'value2' ,
2021-08-29 11:58:11 -07:00
} ,
] ,
2021-05-19 16:07:26 -07:00
default : [ ] ,
2021-05-15 15:51:14 -07:00
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2021-05-15 15:51:14 -07:00
} ,
2021-08-29 11:58:11 -07:00
] ,
2021-05-15 15:51:14 -07:00
nodeValues : {
values : {
propertyValues : [
2021-08-29 11:58:11 -07:00
{
2021-05-15 15:51:14 -07:00
multiSelectValue : [ ] ,
} ,
] ,
} ,
} ,
} ,
2021-05-19 16:07:26 -07:00
output : {
2021-05-19 16:44:27 -07:00
noneDisplayedFalse : {
defaultsFalse : {
values : {
propertyValues : [ { } ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2021-05-19 16:44:27 -07:00
defaultsTrue : {
2021-05-19 16:07:26 -07:00
values : {
propertyValues : [
{
multiSelectValue : [ ] ,
} ,
] ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2021-05-19 16:07:26 -07:00
noneDisplayedTrue : {
defaultsFalse : {
values : {
propertyValues : [ { } ] ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2021-05-19 16:07:26 -07:00
defaultsTrue : {
values : {
propertyValues : [
{
multiSelectValue : [ ] ,
2021-05-19 18:05:44 -07:00
} ,
] ,
2021-05-19 16:07:26 -07:00
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
} ,
2021-05-19 16:07:26 -07:00
{
description :
'complex type "fixedCollection" with "multipleValues: true". Which contains parameter of type "string" with "multipleValues: true" and a custom default value' ,
input : {
nodePropertiesArray : [
2021-08-29 11:58:11 -07:00
{
2021-05-19 16:07:26 -07:00
name : 'values' ,
displayName : 'Values' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
2021-08-29 11:58:11 -07:00
{
2021-05-19 16:07:26 -07:00
name : 'propertyValues' ,
displayName : 'Property' ,
values : [
{
displayName : 'MultiString' ,
2021-05-19 16:44:27 -07:00
name : 'multiString' ,
type : 'string' ,
2021-05-19 16:07:26 -07:00
typeOptions : {
multipleValues : true ,
2021-08-29 11:58:11 -07:00
} ,
2021-05-19 16:07:26 -07:00
default : [ 'value1' ] ,
2021-05-19 18:05:44 -07:00
} ,
2021-05-19 16:07:26 -07:00
] ,
} ,
] ,
} ,
2021-08-29 11:58:11 -07:00
] ,
2021-05-19 16:07:26 -07:00
nodeValues : {
values : {
propertyValues : [
{
multiString : [ 'value1' ] ,
} ,
] ,
} ,
} ,
} ,
2021-05-19 16:44:27 -07:00
output : {
noneDisplayedFalse : {
defaultsFalse : {
values : {
propertyValues : [ { } ] ,
} ,
} ,
defaultsTrue : {
values : {
propertyValues : [
{
multiString : [ 'value1' ] ,
2021-05-19 18:05:44 -07:00
} ,
] ,
2021-05-19 16:44:27 -07:00
} ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
values : {
propertyValues : [ { } ] ,
} ,
} ,
defaultsTrue : {
values : {
propertyValues : [
{
multiString : [ 'value1' ] ,
2021-05-19 18:05:44 -07:00
} ,
2021-05-19 16:44:27 -07:00
] ,
} ,
} ,
} ,
} ,
2021-08-29 11:58:11 -07:00
} ,
2022-05-15 10:28:42 -07:00
{
description :
2022-06-11 09:12:04 -07:00
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has all values set to the default values (by having it as an empty object) in combination with another value' ,
2022-05-15 10:28:42 -07:00
input : {
nodePropertiesArray : [
2022-06-11 09:12:04 -07:00
{
name : 'mode' ,
displayName : 'mode' ,
type : 'string' ,
default : 'mode1' ,
} ,
2022-05-15 10:28:42 -07:00
{
displayName : 'Options' ,
name : 'options' ,
placeholder : 'Add Option' ,
type : 'collection' ,
default : { } ,
options : [
{
displayName : 'Sort' ,
name : 'sort' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
default : { } ,
placeholder : 'Add Sort' ,
options : [
{
displayName : 'Sort' ,
name : 'value' ,
values : [
{
displayName : 'Descending' ,
name : 'descending' ,
type : 'boolean' ,
default : true ,
description : 'Sort by descending order' ,
} ,
{
displayName : 'Order By' ,
name : 'ordering' ,
type : 'options' ,
default : 'date' ,
options : [
{
name : 'Date' ,
value : 'date' ,
} ,
{
name : 'Name' ,
value : 'name' ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
nodeValues : {
2022-06-11 09:12:04 -07:00
mode : 'changed' ,
2022-05-15 10:28:42 -07:00
options : {
2022-06-11 09:12:04 -07:00
sort : {
value : { } ,
} ,
2022-05-15 10:28:42 -07:00
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
2022-06-11 09:12:04 -07:00
mode : 'changed' ,
2022-05-15 10:28:42 -07:00
options : {
2022-06-11 09:12:04 -07:00
sort : {
value : { } ,
} ,
2022-05-15 10:28:42 -07:00
} ,
} ,
defaultsTrue : {
2022-06-11 09:12:04 -07:00
mode : 'changed' ,
2022-05-15 10:28:42 -07:00
options : {
2022-06-11 09:12:04 -07:00
sort : {
value : {
descending : true ,
ordering : 'date' ,
} ,
} ,
2022-05-15 10:28:42 -07:00
} ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
2022-06-11 09:12:04 -07:00
mode : 'changed' ,
2022-05-15 10:28:42 -07:00
options : {
2022-06-11 09:12:04 -07:00
sort : {
value : { } ,
} ,
2022-05-15 10:28:42 -07:00
} ,
} ,
defaultsTrue : {
2022-06-11 09:12:04 -07:00
mode : 'changed' ,
2022-05-15 10:28:42 -07:00
options : {
2022-06-11 09:12:04 -07:00
sort : {
value : {
descending : true ,
ordering : 'date' ,
} ,
} ,
2022-05-15 10:28:42 -07:00
} ,
} ,
} ,
} ,
} ,
{
description :
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has all values set to the default values (by having it as an empty object)' ,
input : {
nodePropertiesArray : [
{
displayName : 'Options' ,
name : 'options' ,
placeholder : 'Add Option' ,
type : 'collection' ,
default : { } ,
options : [
{
displayName : 'Sort' ,
name : 'sort' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
default : { } ,
placeholder : 'Add Sort' ,
options : [
{
displayName : 'Sort' ,
name : 'value' ,
values : [
{
displayName : 'Descending' ,
name : 'descending' ,
type : 'boolean' ,
default : true ,
description : 'Sort by descending order' ,
} ,
{
displayName : 'Order By' ,
name : 'ordering' ,
type : 'options' ,
default : 'date' ,
options : [
{
name : 'Date' ,
value : 'date' ,
} ,
{
name : 'Name' ,
value : 'name' ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
nodeValues : {
options : {
sort : {
value : { } ,
} ,
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
options : {
sort : {
value : { } ,
} ,
} ,
} ,
defaultsTrue : {
options : {
sort : {
value : {
descending : true ,
ordering : 'date' ,
} ,
} ,
} ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
options : {
sort : {
value : { } ,
} ,
} ,
} ,
defaultsTrue : {
options : {
sort : {
value : {
descending : true ,
ordering : 'date' ,
} ,
} ,
} ,
} ,
} ,
} ,
} ,
{
description :
'complex type "collection" which contains a "fixedCollection" with "multipleValues: false" that has all values set to the default values (by having each value set)' ,
input : {
nodePropertiesArray : [
{
displayName : 'Options' ,
name : 'options' ,
placeholder : 'Add Option' ,
type : 'collection' ,
default : { } ,
options : [
{
displayName : 'Sort' ,
name : 'sort' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : false ,
} ,
default : { } ,
options : [
{
displayName : 'Sort' ,
name : 'value' ,
values : [
{
displayName : 'Descending' ,
name : 'descending' ,
type : 'boolean' ,
default : true ,
} ,
{
displayName : 'Order By' ,
name : 'ordering' ,
type : 'options' ,
default : 'date' ,
options : [
{
name : 'Date' ,
value : 'date' ,
} ,
{
name : 'Name' ,
value : 'name' ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
] ,
nodeValues : {
options : {
sort : {
value : {
descending : true ,
ordering : 'date' ,
} ,
} ,
} ,
} ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : {
options : {
sort : {
value : { } ,
} ,
} ,
} ,
defaultsTrue : {
options : {
sort : {
value : {
descending : true ,
ordering : 'date' ,
} ,
} ,
} ,
} ,
} ,
noneDisplayedTrue : {
defaultsFalse : {
options : {
sort : {
value : { } ,
} ,
} ,
} ,
defaultsTrue : {
options : {
sort : {
value : {
descending : true ,
ordering : 'date' ,
} ,
} ,
} ,
} ,
} ,
} ,
} ,
2023-11-13 03:28:55 -08:00
{
description : 'nodeValues is null (for example when resolving expression fails)' ,
input : {
nodePropertiesArray : [
{
displayName : 'Custom Properties' ,
name : 'customPropertiesUi' ,
placeholder : 'Add Custom Property' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'customPropertiesValues' ,
displayName : 'Custom Property' ,
values : [
{
displayName : 'Property Name or ID' ,
name : 'property' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getDealCustomProperties' ,
} ,
default : '' ,
description :
'Name of the property. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
required : true ,
description : 'Value of the property' ,
} ,
] ,
} ,
] ,
} ,
] ,
nodeValues : null ,
} ,
output : {
noneDisplayedFalse : {
defaultsFalse : { } ,
defaultsTrue : { } ,
} ,
noneDisplayedTrue : {
defaultsFalse : { } ,
defaultsTrue : { } ,
} ,
} ,
} ,
2019-06-23 03:35:23 -07:00
] ;
for ( const testData of tests ) {
test ( testData . description , ( ) = > {
// returnDefaults: false | returnNoneDisplayed: false
2022-11-09 06:25:00 -08:00
let result = getNodeParameters (
2019-06-23 03:35:23 -07:00
testData . input . nodePropertiesArray ,
testData . input . nodeValues ,
false ,
false ,
2022-04-28 10:04:09 -07:00
null ,
2019-06-23 03:35:23 -07:00
) ;
expect ( result ) . toEqual ( testData . output . noneDisplayedFalse . defaultsFalse ) ;
// returnDefaults: true | returnNoneDisplayed: false
2022-11-09 06:25:00 -08:00
result = getNodeParameters (
2019-06-23 03:35:23 -07:00
testData . input . nodePropertiesArray ,
testData . input . nodeValues ,
true ,
false ,
2022-04-28 10:04:09 -07:00
null ,
2019-06-23 03:35:23 -07:00
) ;
expect ( result ) . toEqual ( testData . output . noneDisplayedFalse . defaultsTrue ) ;
// returnDefaults: false | returnNoneDisplayed: true
2022-11-09 06:25:00 -08:00
result = getNodeParameters (
2019-06-23 03:35:23 -07:00
testData . input . nodePropertiesArray ,
testData . input . nodeValues ,
false ,
true ,
2022-04-28 10:04:09 -07:00
null ,
2019-06-23 03:35:23 -07:00
) ;
expect ( result ) . toEqual ( testData . output . noneDisplayedTrue . defaultsFalse ) ;
// returnDefaults: true | returnNoneDisplayed: true
2022-11-09 06:25:00 -08:00
result = getNodeParameters (
2019-06-23 03:35:23 -07:00
testData . input . nodePropertiesArray ,
testData . input . nodeValues ,
true ,
true ,
2022-04-28 10:04:09 -07:00
null ,
2019-06-23 03:35:23 -07:00
) ;
expect ( result ) . toEqual ( testData . output . noneDisplayedTrue . defaultsTrue ) ;
} ) ;
}
} ) ;
2024-05-13 05:46:02 -07:00
describe ( 'getNodeHints' , ( ) = > {
//TODO: Add more tests here when hints are added to some node types
test ( 'should return node hints if present in node type' , ( ) = > {
const testType = {
hints : [
{
message : 'TEST HINT' ,
} ,
] ,
} as INodeTypeDescription ;
const workflow = { } as unknown as Workflow ;
const node : INode = {
name : 'Test Node Hints' ,
} as INode ;
const nodeType = testType ;
const hints = getNodeHints ( workflow , node , nodeType ) ;
expect ( hints ) . toHaveLength ( 1 ) ;
expect ( hints [ 0 ] . message ) . toEqual ( 'TEST HINT' ) ;
} ) ;
test ( 'should not include hint if displayCondition is false' , ( ) = > {
const testType = {
hints : [
{
message : 'TEST HINT' ,
displayCondition : 'FALSE DISPLAY CONDITION EXPESSION' ,
} ,
] ,
} as INodeTypeDescription ;
const workflow = {
expression : {
getSimpleParameterValue (
_node : string ,
_parameter : string ,
_mode : string ,
_additionalData = { } ,
) {
return false ;
} ,
} ,
} as unknown as Workflow ;
const node : INode = {
name : 'Test Node Hints' ,
} as INode ;
const nodeType = testType ;
const hints = getNodeHints ( workflow , node , nodeType ) ;
expect ( hints ) . toHaveLength ( 0 ) ;
} ) ;
test ( 'should include hint if displayCondition is true' , ( ) = > {
const testType = {
hints : [
{
message : 'TEST HINT' ,
displayCondition : 'TRUE DISPLAY CONDITION EXPESSION' ,
} ,
] ,
} as INodeTypeDescription ;
const workflow = {
expression : {
getSimpleParameterValue (
_node : string ,
_parameter : string ,
_mode : string ,
_additionalData = { } ,
) {
return true ;
} ,
} ,
} as unknown as Workflow ;
const node : INode = {
name : 'Test Node Hints' ,
} as INode ;
const nodeType = testType ;
const hints = getNodeHints ( workflow , node , nodeType ) ;
expect ( hints ) . toHaveLength ( 1 ) ;
} ) ;
} ) ;
2024-06-25 04:53:31 -07:00
2024-06-04 00:18:17 -07:00
describe ( 'isSingleExecution' , ( ) = > {
test ( 'should determine based on node parameters if it would be executed once' , ( ) = > {
expect ( isSingleExecution ( 'n8n-nodes-base.code' , { } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.code' , { mode : 'runOnceForEachItem' } ) ) . toEqual (
false ,
) ;
expect ( isSingleExecution ( 'n8n-nodes-base.executeWorkflow' , { } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.executeWorkflow' , { mode : 'each' } ) ) . toEqual ( false ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.crateDb' , { } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.crateDb' , { operation : 'update' } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.timescaleDb' , { } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.timescaleDb' , { operation : 'update' } ) ) . toEqual (
true ,
) ;
expect ( isSingleExecution ( 'n8n-nodes-base.microsoftSql' , { } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.microsoftSql' , { operation : 'update' } ) ) . toEqual (
true ,
) ;
expect ( isSingleExecution ( 'n8n-nodes-base.microsoftSql' , { operation : 'delete' } ) ) . toEqual (
true ,
) ;
expect ( isSingleExecution ( 'n8n-nodes-base.questDb' , { } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.mongoDb' , { operation : 'insert' } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.mongoDb' , { operation : 'update' } ) ) . toEqual ( true ) ;
expect ( isSingleExecution ( 'n8n-nodes-base.redis' , { } ) ) . toEqual ( true ) ;
} ) ;
} ) ;
2024-06-25 04:53:31 -07:00
describe ( 'isSubNodeType' , ( ) = > {
const tests : Array < [ boolean , Pick < INodeTypeDescription , ' outputs ' > | null ] > = [
[ false , null ] ,
[ false , { outputs : '={{random_expression}}' } ] ,
[ false , { outputs : [ ] } ] ,
2024-08-29 06:55:53 -07:00
[ false , { outputs : [ NodeConnectionType . Main ] } ] ,
[ true , { outputs : [ NodeConnectionType . AiAgent ] } ] ,
[ true , { outputs : [ NodeConnectionType . Main , NodeConnectionType . AiAgent ] } ] ,
2024-06-25 04:53:31 -07:00
] ;
test . each ( tests ) ( 'should return %p for %o' , ( expected , nodeType ) = > {
expect ( isSubNodeType ( nodeType ) ) . toBe ( expected ) ;
} ) ;
} ) ;
describe ( 'applyDeclarativeNodeOptionParameters' , ( ) = > {
test . each ( [
[
'node with execute method' ,
{
execute : jest.fn ( ) ,
description : {
properties : [ ] ,
} ,
} ,
] ,
[
'node with trigger method' ,
{
trigger : jest.fn ( ) ,
description : {
properties : [ ] ,
} ,
} ,
] ,
[
'node with webhook method' ,
{
webhook : jest.fn ( ) ,
description : {
properties : [ ] ,
} ,
} ,
] ,
[
'a polling node-type' ,
{
description : {
polling : true ,
properties : [ ] ,
} ,
} ,
] ,
[
'a node-type with a non-main output' ,
{
description : {
outputs : [ 'main' , 'ai_agent' ] ,
properties : [ ] ,
} ,
} ,
] ,
] ) ( 'should not modify properties on node with %s method' , ( _ , nodeTypeName ) = > {
const nodeType = nodeTypeName as unknown as INodeType ;
applyDeclarativeNodeOptionParameters ( nodeType ) ;
expect ( nodeType . description . properties ) . toEqual ( [ ] ) ;
} ) ;
} ) ;
2024-09-04 03:06:17 -07:00
describe ( 'convertNodeToAiTool' , ( ) = > {
let fullNodeWrapper : { description : INodeTypeDescription } ;
beforeEach ( ( ) = > {
fullNodeWrapper = {
description : {
displayName : 'Test Node' ,
name : 'testNode' ,
group : [ 'test' ] ,
description : 'A test node' ,
version : 1 ,
defaults : { } ,
inputs : [ NodeConnectionType . Main ] ,
outputs : [ NodeConnectionType . Main ] ,
properties : [ ] ,
} ,
} ;
} ) ;
it ( 'should modify the name and displayName correctly' , ( ) = > {
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . name ) . toBe ( 'testNodeTool' ) ;
2024-10-02 04:31:22 -07:00
expect ( result . description . displayName ) . toBe ( 'Test Node Tool' ) ;
2024-09-04 03:06:17 -07:00
} ) ;
it ( 'should update inputs and outputs' , ( ) = > {
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . inputs ) . toEqual ( [ ] ) ;
expect ( result . description . outputs ) . toEqual ( [ NodeConnectionType . AiTool ] ) ;
} ) ;
it ( 'should remove the usableAsTool property' , ( ) = > {
fullNodeWrapper . description . usableAsTool = true ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . usableAsTool ) . toBeUndefined ( ) ;
} ) ;
it ( "should add toolDescription property if it doesn't exist" , ( ) = > {
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
const toolDescriptionProp = result . description . properties . find (
( prop ) = > prop . name === 'toolDescription' ,
) ;
expect ( toolDescriptionProp ) . toBeDefined ( ) ;
expect ( toolDescriptionProp ? . type ) . toBe ( 'string' ) ;
expect ( toolDescriptionProp ? . default ) . toBe ( fullNodeWrapper . description . description ) ;
} ) ;
it ( 'should set codex categories correctly' , ( ) = > {
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . codex ) . toEqual ( {
categories : [ 'AI' ] ,
subcategories : {
AI : [ 'Tools' ] ,
Tools : [ 'Other Tools' ] ,
} ,
} ) ;
} ) ;
it ( 'should preserve existing properties' , ( ) = > {
const existingProp : INodeProperties = {
displayName : 'Existing Prop' ,
name : 'existingProp' ,
type : 'string' ,
default : 'test' ,
} ;
fullNodeWrapper . description . properties = [ existingProp ] ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
2024-10-02 04:31:22 -07:00
expect ( result . description . properties ) . toHaveLength ( 3 ) ; // Existing prop + toolDescription + notice
2024-09-04 03:06:17 -07:00
expect ( result . description . properties ) . toContainEqual ( existingProp ) ;
} ) ;
2024-10-02 04:31:22 -07:00
it ( 'should handle nodes with resource property' , ( ) = > {
const resourceProp : INodeProperties = {
displayName : 'Resource' ,
name : 'resource' ,
type : 'options' ,
options : [ { name : 'User' , value : 'user' } ] ,
default : 'user' ,
} ;
fullNodeWrapper . description . properties = [ resourceProp ] ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . properties [ 1 ] . name ) . toBe ( 'descriptionType' ) ;
expect ( result . description . properties [ 2 ] . name ) . toBe ( 'toolDescription' ) ;
expect ( result . description . properties [ 3 ] ) . toEqual ( resourceProp ) ;
} ) ;
it ( 'should handle nodes with operation property' , ( ) = > {
const operationProp : INodeProperties = {
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
options : [ { name : 'Create' , value : 'create' } ] ,
default : 'create' ,
} ;
fullNodeWrapper . description . properties = [ operationProp ] ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . properties [ 1 ] . name ) . toBe ( 'descriptionType' ) ;
expect ( result . description . properties [ 2 ] . name ) . toBe ( 'toolDescription' ) ;
expect ( result . description . properties [ 3 ] ) . toEqual ( operationProp ) ;
} ) ;
it ( 'should handle nodes with both resource and operation properties' , ( ) = > {
const resourceProp : INodeProperties = {
displayName : 'Resource' ,
name : 'resource' ,
type : 'options' ,
options : [ { name : 'User' , value : 'user' } ] ,
default : 'user' ,
} ;
const operationProp : INodeProperties = {
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
options : [ { name : 'Create' , value : 'create' } ] ,
default : 'create' ,
} ;
fullNodeWrapper . description . properties = [ resourceProp , operationProp ] ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . properties [ 1 ] . name ) . toBe ( 'descriptionType' ) ;
expect ( result . description . properties [ 2 ] . name ) . toBe ( 'toolDescription' ) ;
expect ( result . description . properties [ 3 ] ) . toEqual ( resourceProp ) ;
expect ( result . description . properties [ 4 ] ) . toEqual ( operationProp ) ;
} ) ;
it ( 'should handle nodes with empty properties' , ( ) = > {
fullNodeWrapper . description . properties = [ ] ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . properties ) . toHaveLength ( 2 ) ;
expect ( result . description . properties [ 1 ] . name ) . toBe ( 'toolDescription' ) ;
} ) ;
it ( 'should handle nodes with existing codex property' , ( ) = > {
fullNodeWrapper . description . codex = {
categories : [ 'Existing' ] ,
subcategories : {
Existing : [ 'Category' ] ,
} ,
} ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . codex ) . toEqual ( {
categories : [ 'AI' ] ,
subcategories : {
AI : [ 'Tools' ] ,
Tools : [ 'Other Tools' ] ,
} ,
} ) ;
} ) ;
it ( 'should handle nodes with very long names' , ( ) = > {
fullNodeWrapper . description . name = 'veryLongNodeNameThatExceedsNormalLimits' . repeat ( 10 ) ;
fullNodeWrapper . description . displayName =
'Very Long Node Name That Exceeds Normal Limits' . repeat ( 10 ) ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . name . endsWith ( 'Tool' ) ) . toBe ( true ) ;
expect ( result . description . displayName . endsWith ( 'Tool' ) ) . toBe ( true ) ;
} ) ;
it ( 'should handle nodes with special characters in name and displayName' , ( ) = > {
fullNodeWrapper . description . name = 'special@#$%Node' ;
fullNodeWrapper . description . displayName = 'Special @#$% Node' ;
const result = convertNodeToAiTool ( fullNodeWrapper ) ;
expect ( result . description . name ) . toBe ( 'special@#$%NodeTool' ) ;
expect ( result . description . displayName ) . toBe ( 'Special @#$% Node Tool' ) ;
} ) ;
2024-09-04 03:06:17 -07:00
} ) ;
2019-06-23 03:35:23 -07:00
} ) ;