This is an automated email from the ASF dual-hosted git repository. marat pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-karavan.git
commit efa4138ffdcd161786a8376df220bb3f1e363940 Author: Marat Gubaidullin <ma...@talismancloud.io> AuthorDate: Tue Feb 20 14:00:55 2024 -0500 Core for #1135 --- karavan-core/src/core/api/CamelDefinitionApi.ts | 95 +++++ .../src/core/api/CamelDefinitionYamlStep.ts | 407 ++++++++++++++------- karavan-core/src/core/model/CamelDefinition.ts | 143 +++++++- karavan-core/src/core/model/CamelMetadata.ts | 107 ++++-- karavan-core/test/getElementProperties.spec.ts | 2 +- karavan-generator/pom.xml | 2 +- 6 files changed, 580 insertions(+), 176 deletions(-) diff --git a/karavan-core/src/core/api/CamelDefinitionApi.ts b/karavan-core/src/core/api/CamelDefinitionApi.ts index 041ac9dd..babc5553 100644 --- a/karavan-core/src/core/api/CamelDefinitionApi.ts +++ b/karavan-core/src/core/api/CamelDefinitionApi.ts @@ -33,6 +33,7 @@ import { ContextScanDefinition, ConvertBodyDefinition, ConvertHeaderDefinition, + ConvertVariableDefinition, DataFormatDefinition, DelayDefinition, DynamicRouterDefinition, @@ -77,6 +78,7 @@ import { RemoveHeadersDefinition, RemovePropertiesDefinition, RemovePropertyDefinition, + RemoveVariableDefinition, ResequenceDefinition, Resilience4jConfigurationDefinition, RestContextRefDefinition, @@ -100,6 +102,7 @@ import { SetHeaderDefinition, SetHeadersDefinition, SetPropertyDefinition, + SetVariableDefinition, SortDefinition, SplitDefinition, StepDefinition, @@ -154,6 +157,7 @@ import { AvroDataFormat, BarcodeDataFormat, Base64DataFormat, + BeanioDataFormat, BindyDataFormat, CBORDataFormat, CryptoDataFormat, @@ -221,6 +225,8 @@ import { SimpleExpression, SpELExpression, TokenizerExpression, + VariableExpression, + WasmExpression, XMLTokenizerExpression, XPathExpression, XQueryExpression, @@ -294,6 +300,9 @@ export class CamelDefinitionApi { if (element?.convertHeaderTo !== undefined) { def.convertHeaderTo = CamelDefinitionApi.createConvertHeaderDefinition(element.convertHeaderTo); } + if (element?.convertVariableTo !== undefined) { + def.convertVariableTo = CamelDefinitionApi.createConvertVariableDefinition(element.convertVariableTo); + } if (element?.delay !== undefined) { def.delay = CamelDefinitionApi.createDelayDefinition(element.delay); } @@ -366,6 +375,9 @@ export class CamelDefinitionApi { if (element?.removeProperty !== undefined) { def.removeProperty = CamelDefinitionApi.createRemovePropertyDefinition(element.removeProperty); } + if (element?.removeVariable !== undefined) { + def.removeVariable = CamelDefinitionApi.createRemoveVariableDefinition(element.removeVariable); + } if (element?.resequence !== undefined) { def.resequence = CamelDefinitionApi.createResequenceDefinition(element.resequence); } @@ -402,6 +414,9 @@ export class CamelDefinitionApi { if (element?.setProperty !== undefined) { def.setProperty = CamelDefinitionApi.createSetPropertyDefinition(element.setProperty); } + if (element?.setVariable !== undefined) { + def.setVariable = CamelDefinitionApi.createSetVariableDefinition(element.setVariable); + } if (element?.sort !== undefined) { def.sort = CamelDefinitionApi.createSortDefinition(element.sort); } @@ -581,6 +596,12 @@ export class CamelDefinitionApi { return def; } + static createConvertVariableDefinition = (element: any): ConvertVariableDefinition => { + const def = element ? new ConvertVariableDefinition({...element}) : new ConvertVariableDefinition(); + def.uuid = element?.uuid ? element.uuid : def.uuid; + return def; + } + static createDataFormatDefinition = (element: any): DataFormatDefinition => { const def = element ? new DataFormatDefinition({...element}) : new DataFormatDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; @@ -698,6 +719,12 @@ export class CamelDefinitionApi { if (element?.tokenize !== undefined) { def.tokenize = CamelDefinitionApi.createTokenizerExpression(element.tokenize); } + if (element?.variable !== undefined) { + def.variable = CamelDefinitionApi.createVariableExpression(element.variable); + } + if (element?.wasm !== undefined) { + def.wasm = CamelDefinitionApi.createWasmExpression(element.wasm); + } if (element?.xpath !== undefined) { def.xpath = CamelDefinitionApi.createXPathExpression(element.xpath); } @@ -864,6 +891,9 @@ export class CamelDefinitionApi { if (element?.base64 !== undefined) { def.base64 = CamelDefinitionApi.createBase64DataFormat(element.base64); } + if (element?.beanio !== undefined) { + def.beanio = CamelDefinitionApi.createBeanioDataFormat(element.beanio); + } if (element?.bindy !== undefined) { def.bindy = CamelDefinitionApi.createBindyDataFormat(element.bindy); } @@ -1151,6 +1181,15 @@ export class CamelDefinitionApi { return def; } + static createRemoveVariableDefinition = (element: any): RemoveVariableDefinition => { + if (element && typeof element === 'string') { + element = {name: element}; + } + const def = element ? new RemoveVariableDefinition({...element}) : new RemoveVariableDefinition(); + def.uuid = element?.uuid ? element.uuid : def.uuid; + return def; + } + static createResequenceDefinition = (element: any): ResequenceDefinition => { const def = element ? new ResequenceDefinition({...element}) : new ResequenceDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; @@ -1346,6 +1385,14 @@ export class CamelDefinitionApi { return def; } + static createSetVariableDefinition = (element: any): SetVariableDefinition => { + const def = element ? new SetVariableDefinition({...element}) : new SetVariableDefinition(); + def.uuid = element?.uuid ? element.uuid : def.uuid; + def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression); + + return def; + } + static createSortDefinition = (element: any): SortDefinition => { const def = element ? new SortDefinition({...element}) : new SortDefinition(); def.uuid = element?.uuid ? element.uuid : def.uuid; @@ -1485,6 +1532,9 @@ export class CamelDefinitionApi { if (element?.base64 !== undefined) { def.base64 = CamelDefinitionApi.createBase64DataFormat(element.base64); } + if (element?.beanio !== undefined) { + def.beanio = CamelDefinitionApi.createBeanioDataFormat(element.beanio); + } if (element?.bindy !== undefined) { def.bindy = CamelDefinitionApi.createBindyDataFormat(element.bindy); } @@ -1915,6 +1965,12 @@ export class CamelDefinitionApi { return def; } + static createBeanioDataFormat = (element: any): BeanioDataFormat => { + const def = element ? new BeanioDataFormat({...element}) : new BeanioDataFormat(); + def.uuid = element?.uuid ? element.uuid : def.uuid; + return def; + } + static createBindyDataFormat = (element: any): BindyDataFormat => { const def = element ? new BindyDataFormat({...element}) : new BindyDataFormat(); def.uuid = element?.uuid ? element.uuid : def.uuid; @@ -1963,6 +2019,9 @@ export class CamelDefinitionApi { if (element?.base64 !== undefined) { def.base64 = CamelDefinitionApi.createBase64DataFormat(element.base64); } + if (element?.beanio !== undefined) { + def.beanio = CamelDefinitionApi.createBeanioDataFormat(element.beanio); + } if (element?.bindy !== undefined) { def.bindy = CamelDefinitionApi.createBindyDataFormat(element.bindy); } @@ -2433,6 +2492,12 @@ export class CamelDefinitionApi { if (element?.tokenize !== undefined) { def.tokenize = CamelDefinitionApi.createTokenizerExpression(element.tokenize); } + if (element?.variable !== undefined) { + def.variable = CamelDefinitionApi.createVariableExpression(element.variable); + } + if (element?.wasm !== undefined) { + def.wasm = CamelDefinitionApi.createWasmExpression(element.wasm); + } if (element?.xpath !== undefined) { def.xpath = CamelDefinitionApi.createXPathExpression(element.xpath); } @@ -2592,6 +2657,24 @@ export class CamelDefinitionApi { return def; } + static createVariableExpression = (element: any): VariableExpression => { + if (element && typeof element === 'string') { + element = {expression: element}; + } + const def = element ? new VariableExpression({...element}) : new VariableExpression(); + def.uuid = element?.uuid ? element.uuid : def.uuid; + return def; + } + + static createWasmExpression = (element: any): WasmExpression => { + if (element && typeof element === 'string') { + element = {expression: element}; + } + const def = element ? new WasmExpression({...element}) : new WasmExpression(); + def.uuid = element?.uuid ? element.uuid : def.uuid; + return def; + } + static createXMLTokenizerExpression = (element: any): XMLTokenizerExpression => { if (element && typeof element === 'string') { element = {expression: element}; @@ -2882,6 +2965,9 @@ export class CamelDefinitionApi { if (element?.base64 !== undefined) { def.base64 = CamelDefinitionApi.createBase64DataFormat(element.base64); } + if (element?.beanio !== undefined) { + def.beanio = CamelDefinitionApi.createBeanioDataFormat(element.beanio); + } if (element?.bindy !== undefined) { def.bindy = CamelDefinitionApi.createBindyDataFormat(element.bindy); } @@ -3074,6 +3160,7 @@ export class CamelDefinitionApi { case 'ContextScanDefinition': return CamelDefinitionApi.createContextScanDefinition(newBody); case 'ConvertBodyDefinition': return CamelDefinitionApi.createConvertBodyDefinition(newBody); case 'ConvertHeaderDefinition': return CamelDefinitionApi.createConvertHeaderDefinition(newBody); + case 'ConvertVariableDefinition': return CamelDefinitionApi.createConvertVariableDefinition(newBody); case 'DataFormatDefinition': return CamelDefinitionApi.createDataFormatDefinition(newBody); case 'DelayDefinition': return CamelDefinitionApi.createDelayDefinition(newBody); case 'DynamicRouterDefinition': return CamelDefinitionApi.createDynamicRouterDefinition(newBody); @@ -3118,6 +3205,7 @@ export class CamelDefinitionApi { case 'RemoveHeadersDefinition': return CamelDefinitionApi.createRemoveHeadersDefinition(newBody); case 'RemovePropertiesDefinition': return CamelDefinitionApi.createRemovePropertiesDefinition(newBody); case 'RemovePropertyDefinition': return CamelDefinitionApi.createRemovePropertyDefinition(newBody); + case 'RemoveVariableDefinition': return CamelDefinitionApi.createRemoveVariableDefinition(newBody); case 'ResequenceDefinition': return CamelDefinitionApi.createResequenceDefinition(newBody); case 'Resilience4jConfigurationDefinition': return CamelDefinitionApi.createResilience4jConfigurationDefinition(newBody); case 'RestContextRefDefinition': return CamelDefinitionApi.createRestContextRefDefinition(newBody); @@ -3141,6 +3229,7 @@ export class CamelDefinitionApi { case 'SetHeaderDefinition': return CamelDefinitionApi.createSetHeaderDefinition(newBody); case 'SetHeadersDefinition': return CamelDefinitionApi.createSetHeadersDefinition(newBody); case 'SetPropertyDefinition': return CamelDefinitionApi.createSetPropertyDefinition(newBody); + case 'SetVariableDefinition': return CamelDefinitionApi.createSetVariableDefinition(newBody); case 'SortDefinition': return CamelDefinitionApi.createSortDefinition(newBody); case 'SplitDefinition': return CamelDefinitionApi.createSplitDefinition(newBody); case 'StepDefinition': return CamelDefinitionApi.createStepDefinition(newBody); @@ -3195,6 +3284,7 @@ export class CamelDefinitionApi { case 'AvroDataFormat': return CamelDefinitionApi.createAvroDataFormat(newBody); case 'BarcodeDataFormat': return CamelDefinitionApi.createBarcodeDataFormat(newBody); case 'Base64DataFormat': return CamelDefinitionApi.createBase64DataFormat(newBody); + case 'BeanioDataFormat': return CamelDefinitionApi.createBeanioDataFormat(newBody); case 'BindyDataFormat': return CamelDefinitionApi.createBindyDataFormat(newBody); case 'CBORDataFormat': return CamelDefinitionApi.createCBORDataFormat(newBody); case 'CryptoDataFormat': return CamelDefinitionApi.createCryptoDataFormat(newBody); @@ -3262,6 +3352,8 @@ export class CamelDefinitionApi { case 'SimpleExpression': return CamelDefinitionApi.createSimpleExpression(newBody); case 'SpELExpression': return CamelDefinitionApi.createSpELExpression(newBody); case 'TokenizerExpression': return CamelDefinitionApi.createTokenizerExpression(newBody); + case 'VariableExpression': return CamelDefinitionApi.createVariableExpression(newBody); + case 'WasmExpression': return CamelDefinitionApi.createWasmExpression(newBody); case 'XMLTokenizerExpression': return CamelDefinitionApi.createXMLTokenizerExpression(newBody); case 'XPathExpression': return CamelDefinitionApi.createXPathExpression(newBody); case 'XQueryExpression': return CamelDefinitionApi.createXQueryExpression(newBody); @@ -3333,6 +3425,8 @@ export class CamelDefinitionApi { case 'SimpleExpression': return CamelDefinitionApi.createSimpleExpression(newBody); case 'SpELExpression': return CamelDefinitionApi.createSpELExpression(newBody); case 'TokenizerExpression': return CamelDefinitionApi.createTokenizerExpression(newBody); + case 'VariableExpression': return CamelDefinitionApi.createVariableExpression(newBody); + case 'WasmExpression': return CamelDefinitionApi.createWasmExpression(newBody); case 'XPathExpression': return CamelDefinitionApi.createXPathExpression(newBody); case 'XQueryExpression': return CamelDefinitionApi.createXQueryExpression(newBody); case 'XMLTokenizerExpression': return CamelDefinitionApi.createXMLTokenizerExpression(newBody); @@ -3349,6 +3443,7 @@ export class CamelDefinitionApi { case 'AvroDataFormat': return CamelDefinitionApi.createAvroDataFormat(newBody); case 'BarcodeDataFormat': return CamelDefinitionApi.createBarcodeDataFormat(newBody); case 'Base64DataFormat': return CamelDefinitionApi.createBase64DataFormat(newBody); + case 'BeanioDataFormat': return CamelDefinitionApi.createBeanioDataFormat(newBody); case 'BindyDataFormat': return CamelDefinitionApi.createBindyDataFormat(newBody); case 'CBORDataFormat': return CamelDefinitionApi.createCBORDataFormat(newBody); case 'CryptoDataFormat': return CamelDefinitionApi.createCryptoDataFormat(newBody); diff --git a/karavan-core/src/core/api/CamelDefinitionYamlStep.ts b/karavan-core/src/core/api/CamelDefinitionYamlStep.ts index 1c43b10c..75e1a121 100644 --- a/karavan-core/src/core/api/CamelDefinitionYamlStep.ts +++ b/karavan-core/src/core/api/CamelDefinitionYamlStep.ts @@ -34,6 +34,7 @@ import { ContextScanDefinition, ConvertBodyDefinition, ConvertHeaderDefinition, + ConvertVariableDefinition, DataFormatDefinition, DelayDefinition, DynamicRouterDefinition, @@ -78,6 +79,7 @@ import { RemoveHeadersDefinition, RemovePropertiesDefinition, RemovePropertyDefinition, + RemoveVariableDefinition, ResequenceDefinition, Resilience4jConfigurationDefinition, RestContextRefDefinition, @@ -101,6 +103,7 @@ import { SetHeaderDefinition, SetHeadersDefinition, SetPropertyDefinition, + SetVariableDefinition, SortDefinition, SplitDefinition, StepDefinition, @@ -155,6 +158,7 @@ import { AvroDataFormat, BarcodeDataFormat, Base64DataFormat, + BeanioDataFormat, BindyDataFormat, CBORDataFormat, CryptoDataFormat, @@ -222,6 +226,8 @@ import { SimpleExpression, SpELExpression, TokenizerExpression, + VariableExpression, + WasmExpression, XMLTokenizerExpression, XPathExpression, XQueryExpression, @@ -574,6 +580,13 @@ export class CamelDefinitionYamlStep { def.removeProperties = CamelDefinitionYamlStep.readRemovePropertiesDefinition(element.removeProperties); } } + if (element?.removeVariable !== undefined) { + if (Array.isArray(element.removeVariable)) { + def.removeVariable = CamelDefinitionYamlStep.readRemoveVariableDefinition(element.removeVariable[0]); + } else { + def.removeVariable = CamelDefinitionYamlStep.readRemoveVariableDefinition(element.removeVariable); + } + } if (element?.policy !== undefined) { if (Array.isArray(element.policy)) { def.policy = CamelDefinitionYamlStep.readPolicyDefinition(element.policy[0]); @@ -609,6 +622,20 @@ export class CamelDefinitionYamlStep { def.process = CamelDefinitionYamlStep.readProcessDefinition(element.process); } } + if (element?.convertVariableTo !== undefined) { + if (Array.isArray(element.convertVariableTo)) { + def.convertVariableTo = CamelDefinitionYamlStep.readConvertVariableDefinition(element.convertVariableTo[0]); + } else { + def.convertVariableTo = CamelDefinitionYamlStep.readConvertVariableDefinition(element.convertVariableTo); + } + } + if (element?.setVariable !== undefined) { + if (Array.isArray(element.setVariable)) { + def.setVariable = CamelDefinitionYamlStep.readSetVariableDefinition(element.setVariable[0]); + } else { + def.setVariable = CamelDefinitionYamlStep.readSetVariableDefinition(element.setVariable); + } + } if (element?.threads !== undefined) { if (Array.isArray(element.threads)) { def.threads = CamelDefinitionYamlStep.readThreadsDefinition(element.threads[0]); @@ -899,6 +926,13 @@ export class CamelDefinitionYamlStep { return def; } + static readConvertVariableDefinition = (element: any): ConvertVariableDefinition => { + + let def = element ? new ConvertVariableDefinition({...element}) : new ConvertVariableDefinition(); + + return def; + } + static readDataFormatDefinition = (element: any): DataFormatDefinition => { let def = element ? new DataFormatDefinition({...element}) : new DataFormatDefinition(); @@ -1005,20 +1039,6 @@ export class CamelDefinitionYamlStep { static readExpressionSubElementDefinition = (element: any): ExpressionSubElementDefinition => { let def = element ? new ExpressionSubElementDefinition({...element}) : new ExpressionSubElementDefinition(); - if (element?.ognl !== undefined) { - if (Array.isArray(element.ognl)) { - def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl[0]); - } else { - def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl); - } - } - if (element?.python !== undefined) { - if (Array.isArray(element.python)) { - def.python = CamelDefinitionYamlStep.readPythonExpression(element.python[0]); - } else { - def.python = CamelDefinitionYamlStep.readPythonExpression(element.python); - } - } if (element?.constant !== undefined) { if (Array.isArray(element.constant)) { def.constant = CamelDefinitionYamlStep.readConstantExpression(element.constant[0]); @@ -1026,27 +1046,6 @@ export class CamelDefinitionYamlStep { def.constant = CamelDefinitionYamlStep.readConstantExpression(element.constant); } } - if (element?.mvel !== undefined) { - if (Array.isArray(element.mvel)) { - def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel[0]); - } else { - def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel); - } - } - if (element?.method !== undefined) { - if (Array.isArray(element.method)) { - def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method[0]); - } else { - def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method); - } - } - if (element?.xquery !== undefined) { - if (Array.isArray(element.xquery)) { - def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery[0]); - } else { - def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery); - } - } if (element?.datasonnet !== undefined) { if (Array.isArray(element.datasonnet)) { def.datasonnet = CamelDefinitionYamlStep.readDatasonnetExpression(element.datasonnet[0]); @@ -1082,13 +1081,6 @@ export class CamelDefinitionYamlStep { def.simple = CamelDefinitionYamlStep.readSimpleExpression(element.simple); } } - if (element?.hl7terser !== undefined) { - if (Array.isArray(element.hl7terser)) { - def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser[0]); - } else { - def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser); - } - } if (element?.tokenize !== undefined) { if (Array.isArray(element.tokenize)) { def.tokenize = CamelDefinitionYamlStep.readTokenizerExpression(element.tokenize[0]); @@ -1096,13 +1088,6 @@ export class CamelDefinitionYamlStep { def.tokenize = CamelDefinitionYamlStep.readTokenizerExpression(element.tokenize); } } - if (element?.spel !== undefined) { - if (Array.isArray(element.spel)) { - def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel[0]); - } else { - def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel); - } - } if (element?.ref !== undefined) { if (Array.isArray(element.ref)) { def.ref = CamelDefinitionYamlStep.readRefExpression(element.ref[0]); @@ -1117,13 +1102,6 @@ export class CamelDefinitionYamlStep { def.xpath = CamelDefinitionYamlStep.readXPathExpression(element.xpath); } } - if (element?.groovy !== undefined) { - if (Array.isArray(element.groovy)) { - def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy[0]); - } else { - def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy); - } - } if (element?.java !== undefined) { if (Array.isArray(element.java)) { def.java = CamelDefinitionYamlStep.readJavaExpression(element.java[0]); @@ -1131,6 +1109,13 @@ export class CamelDefinitionYamlStep { def.java = CamelDefinitionYamlStep.readJavaExpression(element.java); } } + if (element?.wasm !== undefined) { + if (Array.isArray(element.wasm)) { + def.wasm = CamelDefinitionYamlStep.readWasmExpression(element.wasm[0]); + } else { + def.wasm = CamelDefinitionYamlStep.readWasmExpression(element.wasm); + } + } if (element?.csimple !== undefined) { if (Array.isArray(element.csimple)) { def.csimple = CamelDefinitionYamlStep.readCSimpleExpression(element.csimple[0]); @@ -1138,6 +1123,76 @@ export class CamelDefinitionYamlStep { def.csimple = CamelDefinitionYamlStep.readCSimpleExpression(element.csimple); } } + if (element?.jsonpath !== undefined) { + if (Array.isArray(element.jsonpath)) { + def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath[0]); + } else { + def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath); + } + } + if (element?.joor !== undefined) { + if (Array.isArray(element.joor)) { + def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor[0]); + } else { + def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor); + } + } + if (element?.ognl !== undefined) { + if (Array.isArray(element.ognl)) { + def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl[0]); + } else { + def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl); + } + } + if (element?.python !== undefined) { + if (Array.isArray(element.python)) { + def.python = CamelDefinitionYamlStep.readPythonExpression(element.python[0]); + } else { + def.python = CamelDefinitionYamlStep.readPythonExpression(element.python); + } + } + if (element?.mvel !== undefined) { + if (Array.isArray(element.mvel)) { + def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel[0]); + } else { + def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel); + } + } + if (element?.method !== undefined) { + if (Array.isArray(element.method)) { + def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method[0]); + } else { + def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method); + } + } + if (element?.xquery !== undefined) { + if (Array.isArray(element.xquery)) { + def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery[0]); + } else { + def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery); + } + } + if (element?.hl7terser !== undefined) { + if (Array.isArray(element.hl7terser)) { + def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser[0]); + } else { + def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser); + } + } + if (element?.spel !== undefined) { + if (Array.isArray(element.spel)) { + def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel[0]); + } else { + def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel); + } + } + if (element?.groovy !== undefined) { + if (Array.isArray(element.groovy)) { + def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy[0]); + } else { + def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy); + } + } if (element?.exchangeProperty !== undefined) { if (Array.isArray(element.exchangeProperty)) { def.exchangeProperty = CamelDefinitionYamlStep.readExchangePropertyExpression(element.exchangeProperty[0]); @@ -1145,11 +1200,11 @@ export class CamelDefinitionYamlStep { def.exchangeProperty = CamelDefinitionYamlStep.readExchangePropertyExpression(element.exchangeProperty); } } - if (element?.jsonpath !== undefined) { - if (Array.isArray(element.jsonpath)) { - def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath[0]); + if (element?.variable !== undefined) { + if (Array.isArray(element.variable)) { + def.variable = CamelDefinitionYamlStep.readVariableExpression(element.variable[0]); } else { - def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath); + def.variable = CamelDefinitionYamlStep.readVariableExpression(element.variable); } } if (element?.header !== undefined) { @@ -1159,13 +1214,6 @@ export class CamelDefinitionYamlStep { def.header = CamelDefinitionYamlStep.readHeaderExpression(element.header); } } - if (element?.joor !== undefined) { - if (Array.isArray(element.joor)) { - def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor[0]); - } else { - def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor); - } - } if (element?.xtokenize !== undefined) { if (Array.isArray(element.xtokenize)) { def.xtokenize = CamelDefinitionYamlStep.readXMLTokenizerExpression(element.xtokenize[0]); @@ -1541,6 +1589,13 @@ export class CamelDefinitionYamlStep { def.yaml = CamelDefinitionYamlStep.readYAMLDataFormat(element.yaml); } } + if (element?.beanio !== undefined) { + if (Array.isArray(element.beanio)) { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio[0]); + } else { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio); + } + } if (element?.fhirJson !== undefined) { if (Array.isArray(element.fhirJson)) { def.fhirJson = CamelDefinitionYamlStep.readFhirJsonDataFormat(element.fhirJson[0]); @@ -1901,6 +1956,13 @@ export class CamelDefinitionYamlStep { return def; } + static readRemoveVariableDefinition = (element: any): RemoveVariableDefinition => { + if (element && typeof element === 'string') element = {name: element}; + let def = element ? new RemoveVariableDefinition({...element}) : new RemoveVariableDefinition(); + + return def; + } + static readResequenceDefinition = (element: any): ResequenceDefinition => { let def = element ? new ResequenceDefinition({...element}) : new ResequenceDefinition(); @@ -2183,6 +2245,24 @@ export class CamelDefinitionYamlStep { return def; } + static readSetVariableDefinition = (element: any): SetVariableDefinition => { + + let def = element ? new SetVariableDefinition({...element}) : new SetVariableDefinition(); + if (element?.expression !== undefined) { + def.expression = CamelDefinitionYamlStep.readExpressionDefinition(element.expression); + } else { + const languageName: string | undefined = Object.keys(element).filter(key => CamelMetadataApi.hasLanguage(key))[0] || undefined; + if (languageName){ + const exp:any = {}; + exp[languageName] = element[languageName] + def.expression = CamelDefinitionYamlStep.readExpressionDefinition(exp); + delete (def as any)[languageName]; + } + } + + return def; + } + static readSortDefinition = (element: any): SortDefinition => { let def = element ? new SortDefinition({...element}) : new SortDefinition(); @@ -2527,6 +2607,13 @@ export class CamelDefinitionYamlStep { def.yaml = CamelDefinitionYamlStep.readYAMLDataFormat(element.yaml); } } + if (element?.beanio !== undefined) { + if (Array.isArray(element.beanio)) { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio[0]); + } else { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio); + } + } if (element?.fhirJson !== undefined) { if (Array.isArray(element.fhirJson)) { def.fhirJson = CamelDefinitionYamlStep.readFhirJsonDataFormat(element.fhirJson[0]); @@ -3140,6 +3227,13 @@ export class CamelDefinitionYamlStep { return def; } + static readBeanioDataFormat = (element: any): BeanioDataFormat => { + + let def = element ? new BeanioDataFormat({...element}) : new BeanioDataFormat(); + + return def; + } + static readBindyDataFormat = (element: any): BindyDataFormat => { let def = element ? new BindyDataFormat({...element}) : new BindyDataFormat(); @@ -3339,6 +3433,13 @@ export class CamelDefinitionYamlStep { def.yaml = CamelDefinitionYamlStep.readYAMLDataFormat(element.yaml); } } + if (element?.beanio !== undefined) { + if (Array.isArray(element.beanio)) { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio[0]); + } else { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio); + } + } if (element?.fhirJson !== undefined) { if (Array.isArray(element.fhirJson)) { def.fhirJson = CamelDefinitionYamlStep.readFhirJsonDataFormat(element.fhirJson[0]); @@ -3798,20 +3899,6 @@ export class CamelDefinitionYamlStep { static readExpressionDefinition = (element: any): ExpressionDefinition => { let def = element ? new ExpressionDefinition({...element}) : new ExpressionDefinition(); - if (element?.ognl !== undefined) { - if (Array.isArray(element.ognl)) { - def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl[0]); - } else { - def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl); - } - } - if (element?.python !== undefined) { - if (Array.isArray(element.python)) { - def.python = CamelDefinitionYamlStep.readPythonExpression(element.python[0]); - } else { - def.python = CamelDefinitionYamlStep.readPythonExpression(element.python); - } - } if (element?.constant !== undefined) { if (Array.isArray(element.constant)) { def.constant = CamelDefinitionYamlStep.readConstantExpression(element.constant[0]); @@ -3819,27 +3906,6 @@ export class CamelDefinitionYamlStep { def.constant = CamelDefinitionYamlStep.readConstantExpression(element.constant); } } - if (element?.mvel !== undefined) { - if (Array.isArray(element.mvel)) { - def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel[0]); - } else { - def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel); - } - } - if (element?.method !== undefined) { - if (Array.isArray(element.method)) { - def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method[0]); - } else { - def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method); - } - } - if (element?.xquery !== undefined) { - if (Array.isArray(element.xquery)) { - def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery[0]); - } else { - def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery); - } - } if (element?.datasonnet !== undefined) { if (Array.isArray(element.datasonnet)) { def.datasonnet = CamelDefinitionYamlStep.readDatasonnetExpression(element.datasonnet[0]); @@ -3875,13 +3941,6 @@ export class CamelDefinitionYamlStep { def.simple = CamelDefinitionYamlStep.readSimpleExpression(element.simple); } } - if (element?.hl7terser !== undefined) { - if (Array.isArray(element.hl7terser)) { - def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser[0]); - } else { - def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser); - } - } if (element?.tokenize !== undefined) { if (Array.isArray(element.tokenize)) { def.tokenize = CamelDefinitionYamlStep.readTokenizerExpression(element.tokenize[0]); @@ -3889,13 +3948,6 @@ export class CamelDefinitionYamlStep { def.tokenize = CamelDefinitionYamlStep.readTokenizerExpression(element.tokenize); } } - if (element?.spel !== undefined) { - if (Array.isArray(element.spel)) { - def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel[0]); - } else { - def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel); - } - } if (element?.ref !== undefined) { if (Array.isArray(element.ref)) { def.ref = CamelDefinitionYamlStep.readRefExpression(element.ref[0]); @@ -3910,13 +3962,6 @@ export class CamelDefinitionYamlStep { def.xpath = CamelDefinitionYamlStep.readXPathExpression(element.xpath); } } - if (element?.groovy !== undefined) { - if (Array.isArray(element.groovy)) { - def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy[0]); - } else { - def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy); - } - } if (element?.java !== undefined) { if (Array.isArray(element.java)) { def.java = CamelDefinitionYamlStep.readJavaExpression(element.java[0]); @@ -3924,6 +3969,13 @@ export class CamelDefinitionYamlStep { def.java = CamelDefinitionYamlStep.readJavaExpression(element.java); } } + if (element?.wasm !== undefined) { + if (Array.isArray(element.wasm)) { + def.wasm = CamelDefinitionYamlStep.readWasmExpression(element.wasm[0]); + } else { + def.wasm = CamelDefinitionYamlStep.readWasmExpression(element.wasm); + } + } if (element?.csimple !== undefined) { if (Array.isArray(element.csimple)) { def.csimple = CamelDefinitionYamlStep.readCSimpleExpression(element.csimple[0]); @@ -3931,6 +3983,76 @@ export class CamelDefinitionYamlStep { def.csimple = CamelDefinitionYamlStep.readCSimpleExpression(element.csimple); } } + if (element?.jsonpath !== undefined) { + if (Array.isArray(element.jsonpath)) { + def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath[0]); + } else { + def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath); + } + } + if (element?.joor !== undefined) { + if (Array.isArray(element.joor)) { + def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor[0]); + } else { + def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor); + } + } + if (element?.ognl !== undefined) { + if (Array.isArray(element.ognl)) { + def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl[0]); + } else { + def.ognl = CamelDefinitionYamlStep.readOgnlExpression(element.ognl); + } + } + if (element?.python !== undefined) { + if (Array.isArray(element.python)) { + def.python = CamelDefinitionYamlStep.readPythonExpression(element.python[0]); + } else { + def.python = CamelDefinitionYamlStep.readPythonExpression(element.python); + } + } + if (element?.mvel !== undefined) { + if (Array.isArray(element.mvel)) { + def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel[0]); + } else { + def.mvel = CamelDefinitionYamlStep.readMvelExpression(element.mvel); + } + } + if (element?.method !== undefined) { + if (Array.isArray(element.method)) { + def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method[0]); + } else { + def.method = CamelDefinitionYamlStep.readMethodCallExpression(element.method); + } + } + if (element?.xquery !== undefined) { + if (Array.isArray(element.xquery)) { + def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery[0]); + } else { + def.xquery = CamelDefinitionYamlStep.readXQueryExpression(element.xquery); + } + } + if (element?.hl7terser !== undefined) { + if (Array.isArray(element.hl7terser)) { + def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser[0]); + } else { + def.hl7terser = CamelDefinitionYamlStep.readHl7TerserExpression(element.hl7terser); + } + } + if (element?.spel !== undefined) { + if (Array.isArray(element.spel)) { + def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel[0]); + } else { + def.spel = CamelDefinitionYamlStep.readSpELExpression(element.spel); + } + } + if (element?.groovy !== undefined) { + if (Array.isArray(element.groovy)) { + def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy[0]); + } else { + def.groovy = CamelDefinitionYamlStep.readGroovyExpression(element.groovy); + } + } if (element?.exchangeProperty !== undefined) { if (Array.isArray(element.exchangeProperty)) { def.exchangeProperty = CamelDefinitionYamlStep.readExchangePropertyExpression(element.exchangeProperty[0]); @@ -3938,11 +4060,11 @@ export class CamelDefinitionYamlStep { def.exchangeProperty = CamelDefinitionYamlStep.readExchangePropertyExpression(element.exchangeProperty); } } - if (element?.jsonpath !== undefined) { - if (Array.isArray(element.jsonpath)) { - def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath[0]); + if (element?.variable !== undefined) { + if (Array.isArray(element.variable)) { + def.variable = CamelDefinitionYamlStep.readVariableExpression(element.variable[0]); } else { - def.jsonpath = CamelDefinitionYamlStep.readJsonPathExpression(element.jsonpath); + def.variable = CamelDefinitionYamlStep.readVariableExpression(element.variable); } } if (element?.header !== undefined) { @@ -3952,13 +4074,6 @@ export class CamelDefinitionYamlStep { def.header = CamelDefinitionYamlStep.readHeaderExpression(element.header); } } - if (element?.joor !== undefined) { - if (Array.isArray(element.joor)) { - def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor[0]); - } else { - def.joor = CamelDefinitionYamlStep.readJoorExpression(element.joor); - } - } if (element?.xtokenize !== undefined) { if (Array.isArray(element.xtokenize)) { def.xtokenize = CamelDefinitionYamlStep.readXMLTokenizerExpression(element.xtokenize[0]); @@ -4089,6 +4204,20 @@ export class CamelDefinitionYamlStep { return def; } + static readVariableExpression = (element: any): VariableExpression => { + if (element && typeof element === 'string') element = {expression: element}; + let def = element ? new VariableExpression({...element}) : new VariableExpression(); + + return def; + } + + static readWasmExpression = (element: any): WasmExpression => { + if (element && typeof element === 'string') element = {expression: element}; + let def = element ? new WasmExpression({...element}) : new WasmExpression(); + + return def; + } + static readXMLTokenizerExpression = (element: any): XMLTokenizerExpression => { if (element && typeof element === 'string') element = {expression: element}; let def = element ? new XMLTokenizerExpression({...element}) : new XMLTokenizerExpression(); @@ -4581,6 +4710,13 @@ export class CamelDefinitionYamlStep { def.yaml = CamelDefinitionYamlStep.readYAMLDataFormat(element.yaml); } } + if (element?.beanio !== undefined) { + if (Array.isArray(element.beanio)) { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio[0]); + } else { + def.beanio = CamelDefinitionYamlStep.readBeanioDataFormat(element.beanio); + } + } if (element?.fhirJson !== undefined) { if (Array.isArray(element.fhirJson)) { def.fhirJson = CamelDefinitionYamlStep.readFhirJsonDataFormat(element.fhirJson[0]); @@ -4827,6 +4963,7 @@ export class CamelDefinitionYamlStep { case 'claimCheck': return CamelDefinitionYamlStep.readClaimCheckDefinition(newBody); case 'convertBodyTo': return CamelDefinitionYamlStep.readConvertBodyDefinition(newBody); case 'convertHeaderTo': return CamelDefinitionYamlStep.readConvertHeaderDefinition(newBody); + case 'convertVariableTo': return CamelDefinitionYamlStep.readConvertVariableDefinition(newBody); case 'delay': return CamelDefinitionYamlStep.readDelayDefinition(newBody); case 'dynamicRouter': return CamelDefinitionYamlStep.readDynamicRouterDefinition(newBody); case 'enrich': return CamelDefinitionYamlStep.readEnrichDefinition(newBody); @@ -4851,6 +4988,7 @@ export class CamelDefinitionYamlStep { case 'removeHeaders': return CamelDefinitionYamlStep.readRemoveHeadersDefinition(newBody); case 'removeProperties': return CamelDefinitionYamlStep.readRemovePropertiesDefinition(newBody); case 'removeProperty': return CamelDefinitionYamlStep.readRemovePropertyDefinition(newBody); + case 'removeVariable': return CamelDefinitionYamlStep.readRemoveVariableDefinition(newBody); case 'resequence': return CamelDefinitionYamlStep.readResequenceDefinition(newBody); case 'resumable': return CamelDefinitionYamlStep.readResumableDefinition(newBody); case 'rollback': return CamelDefinitionYamlStep.readRollbackDefinition(newBody); @@ -4863,6 +5001,7 @@ export class CamelDefinitionYamlStep { case 'setHeader': return CamelDefinitionYamlStep.readSetHeaderDefinition(newBody); case 'setHeaders': return CamelDefinitionYamlStep.readSetHeadersDefinition(newBody); case 'setProperty': return CamelDefinitionYamlStep.readSetPropertyDefinition(newBody); + case 'setVariable': return CamelDefinitionYamlStep.readSetVariableDefinition(newBody); case 'sort': return CamelDefinitionYamlStep.readSortDefinition(newBody); case 'split': return CamelDefinitionYamlStep.readSplitDefinition(newBody); case 'step': return CamelDefinitionYamlStep.readStepDefinition(newBody); diff --git a/karavan-core/src/core/model/CamelDefinition.ts b/karavan-core/src/core/model/CamelDefinition.ts index 13d6a8fd..478e9916 100644 --- a/karavan-core/src/core/model/CamelDefinition.ts +++ b/karavan-core/src/core/model/CamelDefinition.ts @@ -30,6 +30,7 @@ export class ProcessorDefinition extends CamelElement { claimCheck?: ClaimCheckDefinition; convertBodyTo?: ConvertBodyDefinition | string; convertHeaderTo?: ConvertHeaderDefinition; + convertVariableTo?: ConvertVariableDefinition; delay?: DelayDefinition; dynamicRouter?: DynamicRouterDefinition; enrich?: EnrichDefinition; @@ -54,6 +55,7 @@ export class ProcessorDefinition extends CamelElement { removeHeaders?: RemoveHeadersDefinition | string; removeProperties?: RemovePropertiesDefinition | string; removeProperty?: RemovePropertyDefinition | string; + removeVariable?: RemoveVariableDefinition | string; resequence?: ResequenceDefinition; resumable?: ResumableDefinition; rollback?: RollbackDefinition | string; @@ -66,6 +68,7 @@ export class ProcessorDefinition extends CamelElement { setHeader?: SetHeaderDefinition; setHeaders?: SetHeadersDefinition; setProperty?: SetPropertyDefinition; + setVariable?: SetVariableDefinition; sort?: SortDefinition; split?: SplitDefinition; step?: StepDefinition; @@ -118,6 +121,7 @@ export class OutputAwareFromDefinition extends CamelElement { parameters?: any = {}; steps: CamelElement[] = []; uri: string = ''; + variableReceive?: string; public constructor(init?: Partial<OutputAwareFromDefinition>) { super('OutputAwareFromDefinition'); Object.assign(this, init); @@ -270,6 +274,7 @@ export class ConvertHeaderDefinition extends CamelElement { disabled?: boolean; name: string = ''; type: string = ''; + toName?: string; mandatory?: boolean; charset?: string; public constructor(init?: Partial<ConvertHeaderDefinition>) { @@ -278,6 +283,22 @@ export class ConvertHeaderDefinition extends CamelElement { } } +export class ConvertVariableDefinition extends CamelElement { + stepName?: string = 'convertVariable'; + charset?: string; + description?: string; + disabled?: boolean; + id?: string = 'convertVariable-' + uuidv4().substring(0,4); + mandatory?: boolean; + name: string = ''; + toName?: string; + type: string = ''; + public constructor(init?: Partial<ConvertVariableDefinition>) { + super('ConvertVariableDefinition'); + Object.assign(this, init); + } +} + export class DataFormatDefinition extends CamelElement { stepName?: string = 'dataFormat'; id?: string = 'dataFormat-' + uuidv4().substring(0,4); @@ -323,6 +344,8 @@ export class EnrichDefinition extends CamelElement { description?: string; disabled?: boolean; expression?: ExpressionDefinition; + variableSend?: string; + variableReceive?: string; aggregationStrategy?: string; aggregationStrategyMethodName?: string; aggregationStrategyMethodAllowNull?: string; @@ -331,6 +354,7 @@ export class EnrichDefinition extends CamelElement { cacheSize?: number; ignoreInvalidEndpoint?: boolean; allowOptimisedComponents?: boolean; + autoStartComponents?: boolean; public constructor(init?: Partial<EnrichDefinition>) { super('EnrichDefinition'); Object.assign(this, init); @@ -374,6 +398,8 @@ export class ExpressionSubElementDefinition extends CamelElement { simple?: SimpleExpression | string; spel?: SpELExpression | string; tokenize?: TokenizerExpression | string; + variable?: VariableExpression | string; + wasm?: WasmExpression | string; xpath?: XPathExpression | string; xquery?: XQueryExpression | string; xtokenize?: XMLTokenizerExpression | string; @@ -436,6 +462,7 @@ export class FromDefinition extends CamelElement { id?: string = 'from-' + uuidv4().substring(0,4); description?: string; uri: string = ''; + variableReceive?: string; parameters?: any = {}; steps: CamelElement[] = []; public constructor(init?: Partial<FromDefinition>) { @@ -600,10 +627,13 @@ export class MarshalDefinition extends CamelElement { id?: string = 'marshal-' + uuidv4().substring(0,4); description?: string; disabled?: boolean; + variableSend?: string; + variableReceive?: string; asn1?: ASN1DataFormat | string; avro?: AvroDataFormat | string; barcode?: BarcodeDataFormat; base64?: Base64DataFormat; + beanio?: BeanioDataFormat; bindy?: BindyDataFormat; cbor?: CBORDataFormat; crypto?: CryptoDataFormat; @@ -829,6 +859,7 @@ export class PollEnrichDefinition extends CamelElement { description?: string; disabled?: boolean; expression?: ExpressionDefinition; + variableReceive?: string; aggregationStrategy?: string; aggregationStrategyMethodName?: string; aggregationStrategyMethodAllowNull?: string; @@ -836,6 +867,7 @@ export class PollEnrichDefinition extends CamelElement { timeout?: string; cacheSize?: number; ignoreInvalidEndpoint?: boolean; + autoStartComponents?: boolean; public constructor(init?: Partial<PollEnrichDefinition>) { super('PollEnrichDefinition'); Object.assign(this, init); @@ -984,6 +1016,18 @@ export class RemovePropertyDefinition extends CamelElement { } } +export class RemoveVariableDefinition extends CamelElement { + stepName?: string = 'removeVariable'; + id?: string = 'removeVariable-' + uuidv4().substring(0,4); + description?: string; + disabled?: boolean; + name: string = ''; + public constructor(init?: Partial<RemoveVariableDefinition>) { + super('RemoveVariableDefinition'); + Object.assign(this, init); + } +} + export class ResequenceDefinition extends CamelElement { stepName?: string = 'resequence'; id?: string = 'resequence-' + uuidv4().substring(0,4); @@ -1306,6 +1350,19 @@ export class SetPropertyDefinition extends CamelElement { } } +export class SetVariableDefinition extends CamelElement { + stepName?: string = 'setVariable'; + id?: string = 'setVariable-' + uuidv4().substring(0,4); + description?: string; + disabled?: boolean; + name: string = ''; + expression?: ExpressionDefinition; + public constructor(init?: Partial<SetVariableDefinition>) { + super('SetVariableDefinition'); + Object.assign(this, init); + } +} + export class SortDefinition extends CamelElement { stepName?: string = 'sort'; id?: string = 'sort-' + uuidv4().substring(0,4); @@ -1450,11 +1507,13 @@ export class ThrottleDefinition extends CamelElement { description?: string; disabled?: boolean; expression?: ExpressionDefinition; + mode?: string; correlationExpression?: ExpressionSubElementDefinition; executorService?: string; asyncDelayed?: boolean; callerRunsWhenRejected?: boolean; rejectExecution?: boolean; + timePeriodMillis?: string; public constructor(init?: Partial<ThrottleDefinition>) { super('ThrottleDefinition'); Object.assign(this, init); @@ -1480,6 +1539,8 @@ export class ToDefinition extends CamelElement { id?: string = 'to-' + uuidv4().substring(0,4); description?: string; disabled?: boolean; + variableSend?: string; + variableReceive?: string; uri: string = ''; pattern?: string; parameters?: any = {}; @@ -1495,6 +1556,8 @@ export class ToDynamicDefinition extends CamelElement { description?: string; disabled?: boolean; uri: string = ''; + variableSend?: string; + variableReceive?: string; pattern?: string; cacheSize?: number; ignoreInvalidEndpoint?: boolean; @@ -1553,11 +1616,14 @@ export class UnmarshalDefinition extends CamelElement { id?: string = 'unmarshal-' + uuidv4().substring(0,4); description?: string; disabled?: boolean; + variableSend?: string; + variableReceive?: string; allowNullBody?: boolean; asn1?: ASN1DataFormat | string; avro?: AvroDataFormat | string; barcode?: BarcodeDataFormat; base64?: Base64DataFormat; + beanio?: BeanioDataFormat; bindy?: BindyDataFormat; cbor?: CBORDataFormat; crypto?: CryptoDataFormat; @@ -1658,6 +1724,8 @@ export class WireTapDefinition extends CamelElement { onPrepare?: string; executorService?: string; uri: string = ''; + variableSend?: string; + variableReceive?: string; pattern?: string; cacheSize?: number; ignoreInvalidEndpoint?: boolean; @@ -2095,6 +2163,23 @@ export class Base64DataFormat extends CamelElement { } } +export class BeanioDataFormat extends CamelElement { + dataFormatName?: string = 'beanio'; + id?: string = 'beanio-' + uuidv4().substring(0,4); + mapping: string = ''; + streamName: string = ''; + ignoreUnidentifiedRecords?: boolean; + ignoreUnexpectedRecords?: boolean; + ignoreInvalidRecords?: boolean; + encoding?: string; + beanReaderErrorHandlerType?: string; + unmarshalSingleObject?: boolean; + public constructor(init?: Partial<BeanioDataFormat>) { + super('BeanioDataFormat'); + Object.assign(this, init); + } +} + export class BindyDataFormat extends CamelElement { dataFormatName?: string = 'bindy'; id?: string = 'bindy-' + uuidv4().substring(0,4); @@ -2200,6 +2285,7 @@ export class DataFormatsDefinition extends CamelElement { avro?: AvroDataFormat | string; barcode?: BarcodeDataFormat; base64?: Base64DataFormat; + beanio?: BeanioDataFormat; bindy?: BindyDataFormat; cbor?: CBORDataFormat; crypto?: CryptoDataFormat; @@ -2932,6 +3018,7 @@ export class DatasonnetExpression extends CamelElement { expression: string = ''; bodyMediaType?: string; outputMediaType?: string; + source?: string; resultType?: string; trim?: boolean; public constructor(init?: Partial<DatasonnetExpression>) { @@ -2974,6 +3061,8 @@ export class ExpressionDefinition extends CamelElement { simple?: SimpleExpression | string; spel?: SpELExpression | string; tokenize?: TokenizerExpression | string; + variable?: VariableExpression | string; + wasm?: WasmExpression | string; xpath?: XPathExpression | string; xquery?: XQueryExpression | string; xtokenize?: XMLTokenizerExpression | string; @@ -3010,8 +3099,7 @@ export class Hl7TerserExpression extends CamelElement { expressionName?: string = 'hl7terser'; id?: string = 'hl7terser-' + uuidv4().substring(0,4); expression: string = ''; - headerName?: string; - propertyName?: string; + source?: string; resultType?: string; trim?: boolean; public constructor(init?: Partial<Hl7TerserExpression>) { @@ -3064,8 +3152,7 @@ export class JqExpression extends CamelElement { expressionName?: string = 'jq'; id?: string = 'jq-' + uuidv4().substring(0,4); expression: string = ''; - headerName?: string; - propertyName?: string; + source?: string; resultType?: string; trim?: boolean; public constructor(init?: Partial<JqExpression>) { @@ -3084,8 +3171,7 @@ export class JsonPathExpression extends CamelElement { writeAsString?: boolean; unpackArray?: boolean; option?: string; - headerName?: string; - propertyName?: string; + source?: string; resultType?: string; trim?: boolean; public constructor(init?: Partial<JsonPathExpression>) { @@ -3206,8 +3292,8 @@ export class TokenizerExpression extends CamelElement { group?: string; groupDelimiter?: string; skipFirst?: boolean; - headerName?: string; - propertyName?: string; + source?: string; + resultType?: string; trim?: boolean; public constructor(init?: Partial<TokenizerExpression>) { super('TokenizerExpression'); @@ -3215,6 +3301,30 @@ export class TokenizerExpression extends CamelElement { } } +export class VariableExpression extends CamelElement { + expressionName?: string = 'variable'; + id?: string = 'variable-' + uuidv4().substring(0,4); + expression: string = ''; + trim?: boolean; + public constructor(init?: Partial<VariableExpression>) { + super('VariableExpression'); + Object.assign(this, init); + } +} + +export class WasmExpression extends CamelElement { + expressionName?: string = 'wasm'; + id?: string = 'wasm-' + uuidv4().substring(0,4); + expression: string = ''; + module: string = ''; + resultType?: string; + trim?: boolean; + public constructor(init?: Partial<WasmExpression>) { + super('WasmExpression'); + Object.assign(this, init); + } +} + export class XMLTokenizerExpression extends CamelElement { expressionName?: string = 'xtokenize'; id?: string = 'xtokenize-' + uuidv4().substring(0,4); @@ -3222,8 +3332,8 @@ export class XMLTokenizerExpression extends CamelElement { mode?: string; group?: number; namespace?: PropertyDefinition[] = []; - headerName?: string; - propertyName?: string; + source?: string; + resultType?: string; trim?: boolean; public constructor(init?: Partial<XMLTokenizerExpression>) { super('XMLTokenizerExpression'); @@ -3236,7 +3346,7 @@ export class XPathExpression extends CamelElement { id?: string = 'xpath-' + uuidv4().substring(0,4); expression: string = ''; documentType?: string; - resultType?: string; + resultQName?: string; saxon?: boolean; factoryRef?: string; objectModel?: string; @@ -3244,8 +3354,8 @@ export class XPathExpression extends CamelElement { threadSafety?: boolean; preCompile?: boolean; namespace?: PropertyDefinition[] = []; - headerName?: string; - propertyName?: string; + source?: string; + resultType?: string; trim?: boolean; public constructor(init?: Partial<XPathExpression>) { super('XPathExpression'); @@ -3257,12 +3367,10 @@ export class XQueryExpression extends CamelElement { expressionName?: string = 'xquery'; id?: string = 'xquery-' + uuidv4().substring(0,4); expression: string = ''; - resultType?: string; - type?: string; configurationRef?: string; namespace?: PropertyDefinition[] = []; - headerName?: string; - propertyName?: string; + source?: string; + resultType?: string; trim?: boolean; public constructor(init?: Partial<XQueryExpression>) { super('XQueryExpression'); @@ -3779,6 +3887,7 @@ export class DataFormatTransformerDefinition extends CamelElement { avro?: AvroDataFormat | string; barcode?: BarcodeDataFormat; base64?: Base64DataFormat; + beanio?: BeanioDataFormat; bindy?: BindyDataFormat; cbor?: CBORDataFormat; crypto?: CryptoDataFormat; diff --git a/karavan-core/src/core/model/CamelMetadata.ts b/karavan-core/src/core/model/CamelMetadata.ts index 6e5eaf53..09ff0636 100644 --- a/karavan-core/src/core/model/CamelMetadata.ts +++ b/karavan-core/src/core/model/CamelMetadata.ts @@ -109,6 +109,7 @@ export const DataFormats: [string, string, string][] = [ ['avro','Avro',"Serialize and deserialize messages using Apache Avro binary data format."], ['barcode','Barcode',"Transform strings to various 1D/2D barcode bitmap formats and back."], ['base64','Base64',"Encode and decode data using Base64."], + ['beanio','BeanIO',"Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats)."], ['bindy','Bindy',"Marshal and unmarshal Java beans from and to flat payloads (such as CSV, delimited, fixed length formats, or FIX messages)."], ['cbor','CBOR',"Unmarshal a CBOR payload to POJO and back."], ['crypto','Crypto (Java Cryptographic Extension)',"Encrypt and decrypt messages using Java Cryptography Extension (JCE)."], @@ -189,6 +190,17 @@ export const CamelDataFormatMetadata: ElementMeta[] = [ new PropertyMeta('lineSeparator', 'Line Separator', "The line separators to use. Uses new line characters (CRLF) by default.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('urlSafe', 'Url Safe', "Instead of emitting '' and '/' we emit '-' and '_' respectively. urlSafe is only applied to encode operations. Decoding seamlessly handles both modes. Is by default false.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), ]), + new ElementMeta('beanio', 'BeanioDataFormat', 'BeanIO', "Marshal and unmarshal Java beans to and from flat files (such as CSV, delimited, or fixed length formats).", 'dataformat,transformation,csv', [ + new PropertyMeta('id', 'Id', "The id of this node", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('mapping', 'Mapping', "The BeanIO mapping file. Is by default loaded from the classpath. You can prefix with file:, http:, or classpath: to denote from where to load the mapping file.", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('streamName', 'Stream Name', "The name of the stream to use.", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('ignoreUnidentifiedRecords', 'Ignore Unidentified Records', "Whether to ignore unidentified records.", 'boolean', '', 'false', false, false, false, false, '', ''), + new PropertyMeta('ignoreUnexpectedRecords', 'Ignore Unexpected Records', "Whether to ignore unexpected records.", 'boolean', '', 'false', false, false, false, false, '', ''), + new PropertyMeta('ignoreInvalidRecords', 'Ignore Invalid Records', "Whether to ignore invalid records.", 'boolean', '', 'false', false, false, false, false, '', ''), + new PropertyMeta('encoding', 'Encoding', "The charset to use. Is by default the JVM platform default charset.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('beanReaderErrorHandlerType', 'Bean Reader Error Handler Type', "To use a custom org.apache.camel.dataformat.beanio.BeanIOErrorHandler as error handler while parsing. Configure the fully qualified class name of the error handler. Notice the options ignoreUnidentifiedRecords, ignoreUnexpectedRecords, and ignoreInvalidRecords may not be in use when you use a custom error handler.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('unmarshalSingleObject', 'Unmarshal Single Object', "This options controls whether to unmarshal as a list of objects or as a single object only. The former is the default mode, and the latter is only intended in special use-cases where beanio maps the Camel message to a single POJO bean.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), + ]), new ElementMeta('bindy', 'BindyDataFormat', 'Bindy', "Marshal and unmarshal Java beans from and to flat payloads (such as CSV, delimited, fixed length formats, or FIX messages).", 'dataformat,transformation,csv', [ new PropertyMeta('id', 'Id', "The id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('type', 'Type', "Whether to use Csv, Fixed, or KeyValue.", 'string', 'Csv, Fixed, KeyValue', '', true, false, false, false, '', ''), @@ -263,6 +275,7 @@ export const CamelDataFormatMetadata: ElementMeta[] = [ new PropertyMeta('avro', 'avro', "avro", 'AvroDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('barcode', 'barcode', "barcode", 'BarcodeDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('base64', 'base64', "base64", 'Base64DataFormat', '', '', false, false, false, true, '', ''), + new PropertyMeta('beanio', 'beanio', "beanio", 'BeanioDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('bindy', 'bindy', "bindy", 'BindyDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('cbor', 'cbor', "cbor", 'CBORDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('crypto', 'crypto', "crypto", 'CryptoDataFormat', '', '', false, false, false, true, '', ''), @@ -474,7 +487,7 @@ export const CamelDataFormatMetadata: ElementMeta[] = [ ]), new ElementMeta('parquetAvro', 'ParquetAvroDataFormat', 'Parquet File', "Parquet Avro serialization and de-serialization.", 'dataformat,transformation,file', [ new PropertyMeta('id', 'Id', "The id of this node", 'string', '', '', false, false, false, false, '', ''), - new PropertyMeta('compressionCodecName', 'Compression Codec Name', "Compression codec to use when marshalling.", 'string', '', 'GZIP', false, false, false, false, '', ''), + new PropertyMeta('compressionCodecName', 'Compression Codec Name', "Compression codec to use when marshalling.", 'string', 'UNCOMPRESSED, SNAPPY, GZIP, LZO, BROTLI, LZ4, ZSTD, LZ4_RAW', 'GZIP', false, false, false, false, '', ''), new PropertyMeta('unmarshalType', 'Unmarshal Type', "Class to use when (un)marshalling. If omitted, parquet files are converted into Avro's GenericRecords for unmarshalling and input objects are assumed as GenericRecords for marshalling.", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('lazyLoad', 'Lazy Load', "Whether the unmarshalling should produce an iterator of records or read all the records at once.", 'boolean', '', 'false', false, false, false, false, '', ''), ]), @@ -670,6 +683,8 @@ export const Languages: [string, string, string][] = [ ['simple','Simple',"Evaluates a Camel simple expression."], ['spel','SpEL',"Evaluates a Spring expression (SpEL)."], ['tokenize','Tokenize',"Tokenize text payloads using delimiter patterns."], + ['variable','Variable',"Gets a variable"], + ['wasm','Wasm',"Call a wasm (web assembly) function."], ['xpath','XPath',"Evaluates an XPath expression against an XML payload."], ['xquery','XQuery',"Evaluates an XQuery expressions against an XML payload."], ['xtokenize','XML Tokenize',"Tokenize XML payloads."], @@ -693,6 +708,7 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new PropertyMeta('expression', 'Expression', "The expression value in your chosen language syntax", 'string', '', '', true, false, false, false, '', ''), new PropertyMeta('bodyMediaType', 'Body Media Type', "The String representation of the message's body MediaType", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('outputMediaType', 'Output Media Type', "The String representation of the MediaType to output", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), @@ -723,6 +739,8 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new PropertyMeta('simple', 'simple', "simple", 'null', '', '', false, false, false, false, '', ''), new PropertyMeta('spel', 'spel', "spel", 'null', '', '', false, false, false, false, '', ''), new PropertyMeta('tokenize', 'tokenize', "tokenize", 'null', '', '', false, false, false, false, '', ''), + new PropertyMeta('variable', 'variable', "variable", 'null', '', '', false, false, false, false, '', ''), + new PropertyMeta('wasm', 'wasm', "wasm", 'null', '', '', false, false, false, false, '', ''), new PropertyMeta('xpath', 'xpath', "xpath", 'null', '', '', false, false, false, false, '', ''), new PropertyMeta('xquery', 'xquery', "xquery", 'null', '', '', false, false, false, false, '', ''), new PropertyMeta('xtokenize', 'xtokenize', "xtokenize", 'null', '', '', false, false, false, false, '', ''), @@ -741,8 +759,7 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new ElementMeta('hl7terser', 'Hl7TerserExpression', 'HL7 Terser', "Get the value of a HL7 message field specified by terse location specification syntax.", 'language,hl7', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('expression', 'Expression', "The expression value in your chosen language syntax", 'string', '', '', true, false, false, false, '', ''), - new PropertyMeta('headerName', 'Header Name', "Name of header to use as input, instead of the message body It has as higher precedent than the propertyName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('propertyName', 'Property Name', "Name of property to use as input, instead of the message body. It has a lower precedent than the headerName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), @@ -771,8 +788,7 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new ElementMeta('jq', 'JqExpression', 'JQ', "Evaluates a JQ expression against a JSON message body.", 'language,json', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('expression', 'Expression', "The expression value in your chosen language syntax", 'string', '', '', true, false, false, false, '', ''), - new PropertyMeta('headerName', 'Header Name', "Name of header to use as input, instead of the message body It has as higher precedent than the propertyName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('propertyName', 'Property Name', "Name of property to use as input, instead of the message body. It has a lower precedent than the headerName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), @@ -785,8 +801,7 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new PropertyMeta('writeAsString', 'Write As String', "Whether to write the output of each row/element as a JSON String value instead of a Map/POJO value.", 'boolean', '', 'false', false, false, false, false, '', ''), new PropertyMeta('unpackArray', 'Unpack Array', "Whether to unpack a single element json-array into an object.", 'boolean', '', 'false', false, false, false, false, '', ''), new PropertyMeta('option', 'Option', "To configure additional options on JSONPath. Multiple values can be separated by comma.", 'string', 'DEFAULT_PATH_LEAF_TO_NULL, ALWAYS_RETURN_LIST, AS_PATH_LIST, SUPPRESS_EXCEPTIONS, REQUIRE_PROPERTIES', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('headerName', 'Header Name', "Name of header to use as input, instead of the message body It has as higher precedent than the propertyName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('propertyName', 'Property Name', "Name of property to use as input, instead of the message body. It has a lower precedent than the headerName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), @@ -853,8 +868,20 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new PropertyMeta('group', 'Group', "To group N parts together, for example to split big files into chunks of 1000 lines. You can use simple language as the group to support dynamic group sizes.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('groupDelimiter', 'Group Delimiter', "Sets the delimiter to use when grouping. If this has not been set then token will be used as the delimiter.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('skipFirst', 'Skip First', "To skip the very first element", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), - new PropertyMeta('headerName', 'Header Name', "Name of header to use as input, instead of the message body It has as higher precedent than the propertyName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('propertyName', 'Property Name', "Name of property to use as input, instead of the message body. It has a lower precedent than the headerName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), + ]), + new ElementMeta('variable', 'VariableExpression', 'Variable', "Gets a variable", 'language,core', [ + new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('expression', 'Expression', "The expression value in your chosen language syntax", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), + ]), + new ElementMeta('wasm', 'WasmExpression', 'Wasm', "Call a wasm (web assembly) function.", 'language', [ + new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('expression', 'Expression', "The expression value in your chosen language syntax", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('module', 'Module', "Set the module (the distributable, loadable, and executable unit of code in WebAssembly) resource that provides the expression function.", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), new ElementMeta('xtokenize', 'XMLTokenizerExpression', 'XML Tokenize', "Tokenize XML payloads.", 'language,core,xml', [ @@ -863,15 +890,15 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new PropertyMeta('mode', 'Mode', "The extraction mode. The available extraction modes are: i - injecting the contextual namespace bindings into the extracted token (default) w - wrapping the extracted token in its ancestor context u - unwrapping the extracted token to its child content t - extracting the text content of the specified element", 'string', 'i, w, u, t', 'i', false, false, false, false, '', ''), new PropertyMeta('group', 'Group', "To group N parts together", 'number', '', '', false, false, false, false, '', ''), new PropertyMeta('namespace', 'Namespace', "Injects the XML Namespaces of prefix - uri mappings", 'PropertyDefinition', '', '', false, false, true, true, 'common', ''), - new PropertyMeta('headerName', 'Header Name', "Name of header to use as input, instead of the message body It has as higher precedent than the propertyName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('propertyName', 'Property Name', "Name of property to use as input, instead of the message body. It has a lower precedent than the headerName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), new ElementMeta('xpath', 'XPathExpression', 'XPath', "Evaluates an XPath expression against an XML payload.", 'language,core,xml', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('expression', 'Expression', "The expression value in your chosen language syntax", 'string', '', '', true, false, false, false, '', ''), new PropertyMeta('documentType', 'Document Type', "Name of class for document type The default value is org.w3c.dom.Document", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('resultType', 'Result Type', "Sets the class name of the result type (type from output) The default result type is NodeSet", 'string', 'NUMBER, STRING, BOOLEAN, NODESET, NODE', 'NODESET', false, false, false, false, '', ''), + new PropertyMeta('resultQName', 'Result QName', "Sets the output type supported by XPath.", 'string', 'NUMBER, STRING, BOOLEAN, NODESET, NODE', 'NODESET', false, false, false, false, '', ''), new PropertyMeta('saxon', 'Saxon', "Whether to use Saxon.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('factoryRef', 'Factory Ref', "References to a custom XPathFactory to lookup in the registry", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('objectModel', 'Object Model', "The XPath object model to use", 'string', '', '', false, false, false, false, 'advanced', ''), @@ -879,19 +906,17 @@ export const CamelLanguageMetadata: ElementMeta[] = [ new PropertyMeta('threadSafety', 'Thread Safety', "Whether to enable thread-safety for the returned result of the xpath expression. This applies to when using NODESET as the result type, and the returned set has multiple elements. In this situation there can be thread-safety issues if you process the NODESET concurrently such as from a Camel Splitter EIP in parallel processing mode. This option prevents concurrency issues by doing defensive copies of the nodes. It is recommended [...] new PropertyMeta('preCompile', 'Pre Compile', "Whether to enable pre-compiling the xpath expression during initialization phase. pre-compile is enabled by default. This can be used to turn off, for example in cases the compilation phase is desired at the starting phase, such as if the application is ahead of time compiled (for example with camel-quarkus) which would then load the xpath factory of the built operating system, and not a JVM runtime.", 'boolean', '', 'true', false, f [...] new PropertyMeta('namespace', 'Namespace', "Injects the XML Namespaces of prefix - uri mappings", 'PropertyDefinition', '', '', false, false, true, true, 'common', ''), - new PropertyMeta('headerName', 'Header Name', "Name of header to use as input, instead of the message body It has as higher precedent than the propertyName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('propertyName', 'Property Name', "Name of property to use as input, instead of the message body. It has a lower precedent than the headerName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), new ElementMeta('xquery', 'XQueryExpression', 'XQuery', "Evaluates an XQuery expressions against an XML payload.", 'language,xml', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('expression', 'Expression', "The expression value in your chosen language syntax", 'string', '', '', true, false, false, false, '', ''), - new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), - new PropertyMeta('type', 'Type', "Sets the class name of the result type (type from output) The default result type is NodeSet", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('configurationRef', 'Configuration Ref', "Reference to a saxon configuration instance in the registry to use for xquery (requires camel-saxon). This may be needed to add custom functions to a saxon configuration, so these custom functions can be used in xquery expressions.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('namespace', 'Namespace', "Injects the XML Namespaces of prefix - uri mappings", 'PropertyDefinition', '', '', false, false, true, true, 'common', ''), - new PropertyMeta('headerName', 'Header Name', "Name of header to use as input, instead of the message body It has as higher precedent than the propertyName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), - new PropertyMeta('propertyName', 'Property Name', "Name of property to use as input, instead of the message body. It has a lower precedent than the headerName if both are set.", 'string', '', '', false, false, false, false, 'advanced', ''), + new PropertyMeta('source', 'Source', "Source to use, instead of message body. You can prefix with variable:, header:, or property: to specify kind of source. Otherwise, the source is assumed to be a variable. Use empty or null to use default source, which is the message body.", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('resultType', 'Result Type', "Sets the class of the result type (type from output)", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('trim', 'Trim', "Whether to trim the value to remove leading and trailing whitespaces and line breaks", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), ] @@ -989,6 +1014,7 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('name', 'Name', "Name of message header to convert its value The simple language can be used to define a dynamic evaluated header name to be used. Otherwise a constant name will be used.", 'string', '', '', true, false, false, false, '', ''), new PropertyMeta('type', 'Type', "The java type to convert to", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('toName', 'To Name', "To use another header to store the result. By default, the result is stored in the same header. This option allows to use another header. The simple language can be used to define a dynamic evaluated header name to be used. Otherwise a constant name will be used.", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('mandatory', 'Mandatory', "When mandatory then the conversion must return a value (cannot be null), if this is not possible then NoTypeConversionAvailableException is thrown. Setting this to false could mean conversion is not possible and the value is null.", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), new PropertyMeta('charset', 'Charset', "To use a specific charset when converting", 'string', '', '', false, false, false, false, 'advanced', ''), ]), @@ -1015,6 +1041,8 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('expression', 'Expression', "Expression that computes the endpoint uri to use as the resource endpoint to enrich from", 'ExpressionDefinition', '', '', true, false, false, true, '', ''), + new PropertyMeta('variableSend', 'Variable Send', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('aggregationStrategy', 'Aggregation Strategy', "Sets the AggregationStrategy to be used to merge the reply from the external service, into a single outgoing message. By default Camel will use the reply from the external service as outgoing message.", 'string', '', '', false, false, false, false, '', 'org.apache.camel.AggregationStrategy'), new PropertyMeta('aggregationStrategyMethodName', 'Aggregation Strategy Method Name', "This option can be used to explicit declare the method name to use, when using POJOs as the AggregationStrategy.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('aggregationStrategyMethodAllowNull', 'Aggregation Strategy Method Allow Null', "If this option is false then the aggregate method is not used if there was no data to enrich. If this option is true then null values is used as the oldExchange (when no data to enrich), when using POJOs as the AggregationStrategy.", 'string', '', '', false, false, false, false, 'advanced', ''), @@ -1023,6 +1051,7 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('cacheSize', 'Cache Size', "Sets the maximum size used by the org.apache.camel.spi.ProducerCache which is used to cache and reuse producer when uris are reused. Beware that when using dynamic endpoints then it affects how well the cache can be utilized. If each dynamic endpoint is unique then its best to turn off caching by setting this to -1, which allows Camel to not cache both the producers and endpoints; they are regarded as prototype scoped and will be stopp [...] new PropertyMeta('ignoreInvalidEndpoint', 'Ignore Invalid Endpoint', "Ignore the invalidate endpoint exception when try to create a producer with that endpoint", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('allowOptimisedComponents', 'Allow Optimised Components', "Whether to allow components to optimise enricher if they are org.apache.camel.spi.SendDynamicAware .", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), + new PropertyMeta('autoStartComponents', 'Auto Start Components', "Whether to auto startup components when enricher is starting up.", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), new ElementMeta('filter', 'FilterDefinition', 'Filter', "Filter out messages based using a predicate", 'eip,routing', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), @@ -1093,10 +1122,13 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), + new PropertyMeta('variableSend', 'Variable Send', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('asn1', 'asn1', "asn1", 'ASN1DataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('avro', 'avro', "avro", 'AvroDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('barcode', 'barcode', "barcode", 'BarcodeDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('base64', 'base64', "base64", 'Base64DataFormat', '', '', false, false, false, true, '', ''), + new PropertyMeta('beanio', 'beanio', "beanio", 'BeanioDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('bindy', 'bindy', "bindy", 'BindyDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('cbor', 'cbor', "cbor", 'CBORDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('crypto', 'crypto', "crypto", 'CryptoDataFormat', '', '', false, false, false, true, '', ''), @@ -1190,6 +1222,7 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('expression', 'Expression', "Expression that computes the endpoint uri to use as the resource endpoint to enrich from", 'ExpressionDefinition', '', '', true, false, false, true, '', ''), + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('aggregationStrategy', 'Aggregation Strategy', "Sets the AggregationStrategy to be used to merge the reply from the external service, into a single outgoing message. By default Camel will use the reply from the external service as outgoing message.", 'string', '', '', false, false, false, false, '', 'org.apache.camel.AggregationStrategy'), new PropertyMeta('aggregationStrategyMethodName', 'Aggregation Strategy Method Name', "This option can be used to explicit declare the method name to use, when using POJOs as the AggregationStrategy.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('aggregationStrategyMethodAllowNull', 'Aggregation Strategy Method Allow Null', "If this option is false then the aggregate method is not used if there was no data to enrich. If this option is true then null values is used as the oldExchange (when no data to enrich), when using POJOs as the AggregationStrategy.", 'string', '', '', false, false, false, false, 'advanced', ''), @@ -1197,6 +1230,7 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('timeout', 'Timeout', "Timeout in millis when polling from the external service. The timeout has influence about the poll enrich behavior. It basically operations in three different modes: negative value - Waits until a message is available and then returns it. Warning that this method could block indefinitely if no messages are available. 0 - Attempts to receive a message exchange immediately without waiting and returning null if a message exchange is not availa [...] new PropertyMeta('cacheSize', 'Cache Size', "Sets the maximum size used by the org.apache.camel.spi.ConsumerCache which is used to cache and reuse consumers when uris are reused. Beware that when using dynamic endpoints then it affects how well the cache can be utilized. If each dynamic endpoint is unique then its best to turn off caching by setting this to -1, which allows Camel to not cache both the producers and endpoints; they are regarded as prototype scoped and will be stop [...] new PropertyMeta('ignoreInvalidEndpoint', 'Ignore Invalid Endpoint', "Ignore the invalidate endpoint exception when try to create a producer with that endpoint", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), + new PropertyMeta('autoStartComponents', 'Auto Start Components', "Whether to auto startup components when poll enricher is starting up.", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), ]), new ElementMeta('process', 'ProcessDefinition', 'Process', "Calls a Camel processor", 'eip,endpoint', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), @@ -1251,6 +1285,12 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('name', 'Name', "Name of property to remove.", 'string', '', '', true, false, false, false, '', ''), ]), + new ElementMeta('removeVariable', 'RemoveVariableDefinition', 'Remove Variable', "Removes a named variable", 'eip,transformation', [ + new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), + new PropertyMeta('name', 'Name', "Name of variable to remove.", 'string', '', '', true, false, false, false, '', ''), + ]), new ElementMeta('resequence', 'ResequenceDefinition', 'Resequence', "Resequences (re-order) messages based on an expression", 'eip,routing', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), @@ -1341,6 +1381,13 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('name', 'Name', "Name of exchange property to set a new value. The simple language can be used to define a dynamic evaluated exchange property name to be used. Otherwise a constant name will be used.", 'string', '', '', true, false, false, false, '', ''), new PropertyMeta('expression', 'Expression', "Expression to return the value of the message exchange property", 'ExpressionDefinition', '', '', true, false, false, true, '', ''), ]), + new ElementMeta('setVariable', 'SetVariableDefinition', 'Set Variable', "Sets the value of a variable", 'eip,transformation', [ + new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), + new PropertyMeta('name', 'Name', "Name of variable to set a new value The simple language can be used to define a dynamic evaluated variable name to be used. Otherwise a constant name will be used.", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('expression', 'Expression', "Expression to return the value of the variable", 'ExpressionDefinition', '', '', true, false, false, true, '', ''), + ]), new ElementMeta('sort', 'SortDefinition', 'Sort', "Sorts the contents of the message", 'eip,routing', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), @@ -1353,7 +1400,7 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('expression', 'Expression', "Expression of how to split the message body, such as as-is, using a tokenizer, or using a xpath.", 'ExpressionDefinition', '', '', true, false, false, true, '', ''), - new PropertyMeta('delimiter', 'Delimiter', "Delimiter used in splitting messages. Can be turned off using the value false. The default value is ,", 'string', '', ',', false, false, false, false, '', ''), + new PropertyMeta('delimiter', 'Delimiter', "Delimiter used in splitting messages. Can be turned off using the value false. To force not splitting then the delimiter can be set to single to use the value as a single list, this can be needed in some special situations. The default value is comma.", 'string', '', ',', false, false, false, false, '', ''), new PropertyMeta('aggregationStrategy', 'Aggregation Strategy', "Sets a reference to the AggregationStrategy to be used to assemble the replies from the split messages, into a single outgoing message from the Splitter. By default Camel will use the original incoming message to the splitter (leave it unchanged). You can also use a POJO as the AggregationStrategy", 'string', '', '', false, false, false, false, '', 'org.apache.camel.AggregationStrategy'), new PropertyMeta('aggregationStrategyMethodName', 'Aggregation Strategy Method Name', "This option can be used to explicit declare the method name to use, when using POJOs as the AggregationStrategy.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('aggregationStrategyMethodAllowNull', 'Aggregation Strategy Method Allow Null', "If this option is false then the aggregate method is not used if there was no data to enrich. If this option is true then null values is used as the oldExchange (when no data to enrich), when using POJOs as the AggregationStrategy", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), @@ -1399,11 +1446,13 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('expression', 'Expression', "Expression to configure the maximum number of messages to throttle per request", 'ExpressionDefinition', '', '', true, false, false, true, '', ''), + new PropertyMeta('mode', 'Mode', "Sets the throttling mode to one of the available modes enumerated in ThrottlingMode", 'string', 'TotalRequests, ConcurrentRequests', 'TotalRequests', false, false, false, false, '', ''), new PropertyMeta('correlationExpression', 'Correlation Expression', "The expression used to calculate the correlation key to use for throttle grouping. The Exchange which has the same correlation key is throttled together.", 'ExpressionSubElementDefinition', '', '', false, false, false, true, '', ''), new PropertyMeta('executorService', 'Executor Service', "To use a custom thread pool (ScheduledExecutorService) by the throttler.", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('asyncDelayed', 'Async Delayed', "Enables asynchronous delay which means the thread will not block while delaying.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('callerRunsWhenRejected', 'Caller Runs When Rejected', "Whether or not the caller should run the task when it was rejected by the thread pool. Is by default true", 'boolean', '', 'true', false, false, false, false, 'advanced', ''), new PropertyMeta('rejectExecution', 'Reject Execution', "Whether or not throttler throws the ThrottlerRejectedExecutionException when the exchange exceeds the request limit Is by default false", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), + new PropertyMeta('timePeriodMillis', 'Time Period Millis', "Sets the time period during which the maximum request count is valid for", 'string', '', '1000', false, false, false, false, '', ''), ]), new ElementMeta('throwException', 'ThrowExceptionDefinition', 'Throw Exception', "Throws an exception", 'error', [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), @@ -1417,6 +1466,8 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), + new PropertyMeta('variableSend', 'Variable Send', "To use a variable as the source for the message body to send. This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using send variable then the message body is taken from this variable instead of the current Message , however the headers from the Message will still be used as well. In other words, the variable is used instead of the message body, but [...] + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('uri', 'Uri', "Sets the uri of the endpoint to send to.", 'string', '', '', true, false, false, false, '', ''), new PropertyMeta('pattern', 'Pattern', "Sets the optional ExchangePattern used to invoke this endpoint", 'string', 'InOnly, InOut', '', false, false, false, false, 'advanced', ''), new PropertyMeta('parameters', 'parameters', "parameters", 'object', '', '', false, false, false, false, '', ''), @@ -1426,6 +1477,8 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('uri', 'Uri', "The uri of the endpoint to send to. The uri can be dynamic computed using the org.apache.camel.language.simple.SimpleLanguage expression.", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('variableSend', 'Variable Send', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable as the source for the message body to send. This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using send variable then the message body is taken from this variable instead of the current Message , however the headers from the Message will still be used as well. In other words, the variable is used instead of the message body [...] new PropertyMeta('pattern', 'Pattern', "Sets the optional ExchangePattern used to invoke this endpoint", 'string', 'InOnly, InOut', '', false, false, false, false, 'advanced', ''), new PropertyMeta('cacheSize', 'Cache Size', "Sets the maximum size used by the org.apache.camel.spi.ProducerCache which is used to cache and reuse producers when using this recipient list, when uris are reused. Beware that when using dynamic endpoints then it affects how well the cache can be utilized. If each dynamic endpoint is unique then its best to turn off caching by setting this to -1, which allows Camel to not cache both the producers and endpoints; they are regarded as p [...] new PropertyMeta('ignoreInvalidEndpoint', 'Ignore Invalid Endpoint', "Whether to ignore invalid endpoint URIs and skip sending the message.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), @@ -1460,11 +1513,14 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('disabled', 'Disabled', "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), - new PropertyMeta('allowNullBody', 'Allow Null Body', "Indicates whether null is allowed as value of a body to unmarshall.", 'boolean', '', 'false', false, false, false, false, '', ''), + new PropertyMeta('variableSend', 'Variable Send', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('allowNullBody', 'Allow Null Body', "Indicates whether null is allowed as value of a body to unmarshall.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), new PropertyMeta('asn1', 'asn1', "asn1", 'ASN1DataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('avro', 'avro', "avro", 'AvroDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('barcode', 'barcode', "barcode", 'BarcodeDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('base64', 'base64', "base64", 'Base64DataFormat', '', '', false, false, false, true, '', ''), + new PropertyMeta('beanio', 'beanio', "beanio", 'BeanioDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('bindy', 'bindy', "bindy", 'BindyDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('cbor', 'cbor', "cbor", 'CBORDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('crypto', 'crypto', "crypto", 'CryptoDataFormat', '', '', false, false, false, true, '', ''), @@ -1532,6 +1588,8 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('onPrepare', 'On Prepare', "Uses the Processor when preparing the org.apache.camel.Exchange to be sent. This can be used to deep-clone messages that should be sent, or any custom logic needed before the exchange is sent.", 'string', '', '', false, false, false, false, 'advanced', 'org.apache.camel.Processor'), new PropertyMeta('executorService', 'Executor Service', "Uses a custom thread pool", 'string', '', '', false, false, false, false, 'advanced', ''), new PropertyMeta('uri', 'Uri', "The uri of the endpoint to send to. The uri can be dynamic computed using the org.apache.camel.language.simple.SimpleLanguage expression.", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('variableSend', 'Variable Send', "To use a variable to store the received message body (only body, not headers). This is handy for easy access to the received message body via variables. Important: When using receive variable then the received body is stored only in this variable and not on the current org.apache.camel.Message .", 'string', '', '', false, false, false, false, '', ''), + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable as the source for the message body to send. This makes it handy to use variables for user data and to easily control what data to use for sending and receiving. Important: When using send variable then the message body is taken from this variable instead of the current Message , however the headers from the Message will still be used as well. In other words, the variable is used instead of the message body [...] new PropertyMeta('pattern', 'Pattern', "Sets the optional ExchangePattern used to invoke this endpoint", 'string', 'InOnly, InOut', '', false, false, false, false, 'advanced', ''), new PropertyMeta('cacheSize', 'Cache Size', "Sets the maximum size used by the org.apache.camel.spi.ProducerCache which is used to cache and reuse producers when using this recipient list, when uris are reused. Beware that when using dynamic endpoints then it affects how well the cache can be utilized. If each dynamic endpoint is unique then its best to turn off caching by setting this to -1, which allows Camel to not cache both the producers and endpoints; they are regarded as p [...] new PropertyMeta('ignoreInvalidEndpoint', 'Ignore Invalid Endpoint', "Whether to ignore invalid endpoint URIs and skip sending the message.", 'boolean', '', 'false', false, false, false, false, 'advanced', ''), @@ -1739,6 +1797,7 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('id', 'Id', "Sets the id of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('description', 'Description', "Sets the description of this node", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('uri', 'Uri', "Sets the URI of the endpoint to use", 'string', '', '', true, false, false, false, '', ''), + new PropertyMeta('variableReceive', 'Variable Receive', "To use a variable to store a copy of the received message body (only body, not headers). This is handy for easy access to the received message body via variables.", 'string', '', '', false, false, false, false, '', ''), new PropertyMeta('parameters', 'parameters', "parameters", 'object', '', '', false, false, false, false, '', ''), new PropertyMeta('steps', 'steps', "steps", 'CamelElement', '', '', false, false, true, true, '', ''), ]), @@ -1907,6 +1966,7 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('avro', 'avro', "avro", 'AvroDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('barcode', 'barcode', "barcode", 'BarcodeDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('base64', 'base64', "base64", 'Base64DataFormat', '', '', false, false, false, true, '', ''), + new PropertyMeta('beanio', 'beanio', "beanio", 'BeanioDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('bindy', 'bindy', "bindy", 'BindyDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('cbor', 'cbor', "cbor", 'CBORDataFormat', '', '', false, false, false, true, '', ''), new PropertyMeta('crypto', 'crypto', "crypto", 'CryptoDataFormat', '', '', false, false, false, true, '', ''), @@ -2039,6 +2099,8 @@ export const CamelModelMetadata: ElementMeta[] = [ new PropertyMeta('simple', 'simple', "simple", 'SimpleExpression', '', '', false, false, false, true, '', ''), new PropertyMeta('spel', 'spel', "spel", 'SpELExpression', '', '', false, false, false, true, '', ''), new PropertyMeta('tokenize', 'tokenize', "tokenize", 'TokenizerExpression', '', '', false, false, false, true, '', ''), + new PropertyMeta('variable', 'variable', "variable", 'VariableExpression', '', '', false, false, false, true, '', ''), + new PropertyMeta('wasm', 'wasm', "wasm", 'WasmExpression', '', '', false, false, false, true, '', ''), new PropertyMeta('xpath', 'xpath', "xpath", 'XPathExpression', '', '', false, false, false, true, '', ''), new PropertyMeta('xquery', 'xquery', "xquery", 'XQueryExpression', '', '', false, false, false, true, '', ''), new PropertyMeta('xtokenize', 'xtokenize', "xtokenize", 'XMLTokenizerExpression', '', '', false, false, false, true, '', ''), @@ -2304,6 +2366,7 @@ export const SensitiveKeys: string[] = [ "securerandom", "keystore", "refreshtoken", + "sessiontoken", "publishkey", "accountsid", "emailaddress", @@ -2316,11 +2379,10 @@ export const SensitiveKeys: string[] = [ "zookeeperpassword", "apiuser", "cipherkey", - "oauthappid", + "personalaccesstoken", "authkey", "privatekeyname", "systemid", - "oauthappsecret", "secretkey", "webhookverifytoken", "privatekeypassword", @@ -2350,7 +2412,6 @@ export const SensitiveKeys: string[] = [ "api_key", "sasljaasconfig", "httpproxypassword", - "oauthaccesstoken", "user", "api_secret", "passcode", diff --git a/karavan-core/test/getElementProperties.spec.ts b/karavan-core/test/getElementProperties.spec.ts index f14d7740..0b94d940 100644 --- a/karavan-core/test/getElementProperties.spec.ts +++ b/karavan-core/test/getElementProperties.spec.ts @@ -27,7 +27,7 @@ describe('getElementProperties', () => { it('getElementProperties 1', () => { const p: PropertyMeta[] = CamelDefinitionApiExt.getElementProperties("FromDefinition"); - expect(p.length).to.equal(4); + expect(p.length).to.equal(5); }); diff --git a/karavan-generator/pom.xml b/karavan-generator/pom.xml index 9f90420d..3eccb0bc 100644 --- a/karavan-generator/pom.xml +++ b/karavan-generator/pom.xml @@ -28,7 +28,7 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <surefire-plugin.version>3.0.0-M5</surefire-plugin.version> - <version.camel-core>4.3.0</version.camel-core> + <version.camel-core>4.4.0</version.camel-core> <version.camel-kamelet>4.3.0</version.camel-kamelet> <camel.k.extension.version>6.7.2</camel.k.extension.version> <version.vertx>4.5.1</version.vertx>