You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ma...@apache.org on 2025/12/08 16:18:19 UTC
(camel-karavan) 01/04: Prepare for 4.14.3
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 21c07a78d92a824e58dbc3b861b9d61fbf1282a9
Author: Marat Gubaidullin <ma...@talismancloud.io>
AuthorDate: Mon Dec 8 10:49:13 2025 -0500
Prepare for 4.14.3
---
.../apache/camel/karavan/KaravanStartupLoader.java | 1 +
.../apache/camel/karavan/api/DevModeResource.java | 16 +-
.../camel/karavan/api/ProjectFileResource.java | 18 +-
.../apache/camel/karavan/cache/CamelStatus.java | 2 -
.../camel/karavan/cache/CamelStatusValue.java | 5 -
.../camel/karavan/docker/DockerEventHandler.java | 2 +-
.../listener/PodContainerStatusListener.java | 3 +-
.../apache/camel/karavan/service/CodeService.java | 11 +-
.../camel/karavan/service/ComplexityService.java | 19 +-
.../templates/docker/application.properties | 47 +-
.../templates/kubernetes/application.properties | 46 +-
karavan-app/src/main/webui/package-lock.json | 101 +-
karavan-app/src/main/webui/package.json | 4 +-
.../context/ProjectContainersContextProvider.tsx | 49 -
.../src/accelerator/developer/EditorToolbar.tsx | 50 -
.../src/accelerator/toolbar/DevModeToolbar.css | 60 -
.../src/accelerator/toolbar/ProjectToolbar.tsx | 42 -
.../toolbar/ProjectsToolbarAccelerator.tsx | 9 -
.../main/webui/src/accelerator/utils/FileUtils.ts | 31 -
.../webui/src/diagnostics/ContainerStatusRow.tsx | 53 -
.../src/diagnostics/ContainerStatusesTable.tsx | 54 -
.../src/diagnostics/DeploymentStatusesTable.tsx | 53 -
.../main/webui/src/diagnostics/DiagnosticsPage.tsx | 158 -
karavan-app/src/main/webui/src/icons/docker.svg | 2 -
karavan-app/src/main/webui/src/icons/jar.svg | 2 -
karavan-app/src/main/webui/src/icons/log.svg | 2 -
karavan-app/src/main/webui/src/index.css | 85 +-
karavan-app/src/main/webui/src/index.tsx | 9 +-
.../src/integration-runtime/InfoTabContainer.tsx | 97 -
.../src/integration-runtime/InfoTabContext.tsx | 190 -
.../src/integration-runtime/InfoTabMemory.tsx | 176 -
.../src/integration-runtime/InformationTab.tsx | 55 -
.../webui/src/integration-runtime/ProjectLog.css | 53 -
.../src/integration-runtime/ProjectLogTab.tsx | 50 -
.../webui/src/integration-runtime/RuntimeApi.tsx | 57 -
.../webui/src/integration-runtime/RuntimeModels.ts | 6 -
.../webui/src/integration-runtime/RuntimePanel.tsx | 110 -
.../src/main/webui/src/integration/ProjectPage.css | 135 -
.../main/webui/src/integration/ResourceToolbar.tsx | 83 -
.../main/webui/src/integration/files/FilesTab.tsx | 215 -
.../src/integration/package/ContainerPanel.tsx | 73 -
.../webui/src/integrations/ProjectStatusLabel.tsx | 65 -
.../src/karavan-core/api/CamelDefinitionApi.ts | 3416 ++++++++++++++
.../src/karavan-core/api/CamelDefinitionApiExt.ts | 865 ++++
.../src/karavan-core/api/CamelDefinitionYaml.ts | 432 ++
.../karavan-core/api/CamelDefinitionYamlStep.ts | 4946 ++++++++++++++++++++
.../webui/src/karavan-core/api/CamelDisplayUtil.ts | 144 +
.../main/webui/src/karavan-core/api/CamelUtil.ts | 390 ++
.../webui/src/karavan-core/api/ComponentApi.ts | 372 ++
.../main/webui/src/karavan-core/api/KameletApi.ts | 160 +
.../src/karavan-core/api/MainConfigurationApi.ts | 87 +
.../webui/src/karavan-core/api/ProjectModelApi.ts | 75 +
.../main/webui/src/karavan-core/api/SpiBeanApi.ts | 104 +
.../main/webui/src/karavan-core/api/TemplateApi.ts | 58 +
.../webui/src/karavan-core/api/TopologyUtils.ts | 588 +++
.../webui/src/karavan-core/api/VariableUtil.ts | 105 +
.../src/main/webui/src/karavan-core/contants.ts | 26 +
.../src/karavan-core/model/CamelDefinition.ts | 3942 ++++++++++++++++
.../webui/src/karavan-core/model/CamelMetadata.ts | 2929 ++++++++++++
.../src/karavan-core/model/ComponentModels.ts | 108 +
.../karavan-core/model/IntegrationDefinition.ts | 188 +
.../webui/src/karavan-core/model/KameletModels.ts | 224 +
.../model/MainConfigurationModel.ts} | 40 +-
.../model/ProjectModel.ts} | 39 +-
.../model/SpiBeanModels.ts} | 51 +-
.../src/karavan-core/model/TopologyDefinition.ts | 185 +
.../src/{access => karavan/api}/AccessApi.tsx | 6 +-
.../src/main/webui/src/karavan/api/CustomApi.ts | 21 +
.../developer => karavan/api}/DeveloperApi.tsx | 4 +-
.../api}/DiagnosticsApi.tsx | 6 +-
.../webui/src/{ => karavan}/api/KaravanApi.tsx | 27 +-
.../webui/src/{ => karavan}/api/LogWatchApi.tsx | 7 +-
.../src/{ => karavan}/api/NotificationApi.tsx | 6 +-
.../main/webui/src/{ => karavan}/api/SearchApi.tsx | 6 +-
.../src/{system => karavan/api}/SystemApi.tsx | 6 +-
.../webui/src/{ => karavan/api}/auth/AuthApi.tsx | 8 +-
.../src/{ => karavan/api}/auth/AuthProvider.tsx | 6 +-
.../webui/src/{ => karavan/api}/auth/SsoApi.tsx | 4 +-
.../src/{main/Main.css => karavan/app/App.css} | 0
karavan-app/src/main/webui/src/karavan/app/App.tsx | 83 +
.../useMainHook.tsx => karavan/app/MainHook.tsx} | 37 +-
.../app/ReadinessPanel.tsx} | 35 +-
.../src/{main => karavan/app/login}/LoginPage.css | 0
.../src/{main => karavan/app/login}/LoginPage.tsx | 14 +-
.../{main => karavan/app/login}/UserPopupOidc.tsx | 6 +-
.../src/karavan/app/navigation/MainRoutes.tsx | 53 +
.../src/karavan/app/navigation/NavigationMenu.tsx | 42 +
.../app/navigation}/NotAuthorizedPage.tsx | 2 +-
.../app/navigation}/PageNavigation.css | 74 +-
.../app/navigation}/PageNavigation.tsx | 71 +-
.../app/navigation/ProjectFunctionHook.tsx} | 51 +-
.../app/navigation}/ProtectedRoute.tsx | 11 +-
.../src/{main => karavan/app/navigation}/Routes.ts | 5 +-
.../{main => karavan/app/theme}/DarkModeToggle.tsx | 0
.../{main => karavan/app/theme}/ThemeContext.tsx | 0
.../src/{api => karavan/bus}/ErrorEventBus.ts | 0
.../src/{api => karavan/bus}/ProjectEventBus.ts | 0
.../{ => karavan/features}/access/AccessPage.css | 0
.../{ => karavan/features}/access/AccessPage.tsx | 26 +-
.../features/access/roles}/RoleModal.tsx | 14 +-
.../features/access/roles}/RolesTable.tsx | 8 +-
.../features/access/roles}/RolesTableRow.tsx | 6 +-
.../features/access/users}/ChangePassword.tsx | 8 +-
.../features/access/users}/PasswordModal.tsx | 10 +-
.../features/access/users}/UserModal.tsx | 16 +-
.../features/access/users}/UserProfile.tsx | 10 +-
.../features/access/users}/UserProfileTab.tsx | 4 +-
.../features/access/users}/UsersTable.tsx | 6 +-
.../features/access/users}/UsersTableRow.tsx | 10 +-
.../features/diagnostics/camel}/CamelStatusRow.tsx | 2 +-
.../diagnostics/camel}/CamelStatusesTable.tsx | 2 +-
.../features}/documentation/Documentation.css | 0
.../features}/documentation/DocumentationPage.tsx | 22 +-
.../documentation/components/ComponentCard.tsx | 10 +-
.../documentation/components/ComponentModal.tsx | 10 +-
.../documentation/components/ComponentsTab.tsx | 4 +-
.../features}/documentation/eip/EipCard.tsx | 10 +-
.../features}/documentation/eip/EipModal.tsx | 8 +-
.../features}/documentation/eip/EipTab.tsx | 8 +-
.../documentation/kamelets/KameletCard.tsx | 12 +-
.../documentation/kamelets/KameletModal.tsx | 17 +-
.../documentation/kamelets/KameletsTab.tsx | 4 +-
.../features/integration/ContainerLogTab.tsx | 69 +
.../features}/integration/DesignerSwitch.css | 0
.../features}/integration/DesignerToggle.tsx | 6 +-
.../integration/FileSearchToolbarItem.tsx | 7 +-
.../features}/integration/ImageDownloadToolbar.tsx | 15 +-
.../features}/integration/Project.types.ts | 8 +-
.../integration/ProjectContainerContextToolbar.tsx | 67 +
.../ProjectContainersContextProvider.tsx | 81 +
.../features}/integration/ProjectContext.tsx | 0
.../karavan/features/integration/ProjectPage.css | 299 ++
.../features}/integration/ProjectPage.tsx | 82 +-
.../features/integration/ProjectPageNavigation.tsx | 144 +
.../features}/integration/ProjectPanel.tsx | 40 +-
.../features}/integration/ProjectTitle.tsx | 2 +-
.../features}/integration/RenameFileModal.tsx | 13 +-
.../integration/beans/BeanFilesDropdown.tsx | 9 +-
.../features}/integration/beans/BeanWizard.tsx | 28 +-
.../features/integration/designer}/CodeStore.ts | 0
.../integration/designer}/DesignerStore.ts | 6 +-
.../integration/designer}/ErrorBoundaryWrapper.tsx | 0
.../integration/designer}/KaravanDesigner.css | 0
.../integration/designer}/KaravanDesigner.tsx | 12 +-
.../designer}/KaravanDesignerViewSwitch.tsx | 4 +-
.../integration/designer}/beans/BeanCard.tsx | 4 +-
.../integration/designer}/beans/BeansDesigner.tsx | 10 +-
.../features/integration/designer}/beans/bean.css | 0
.../integration/designer}/editor/CodeEditor.tsx | 6 +-
.../integration/designer}/icons/ComponentIcons.tsx | 0
.../integration/designer}/icons/EipIcons.tsx | 0
.../integration/designer}/icons/KaravanIcons.tsx | 155 +-
.../integration/designer}/icons/OtherIcons.tsx | 0
.../designer}/kamelet/KameletAnnotationsPanel.tsx | 2 +-
.../kamelet/KameletDefinitionPropertyCard.tsx | 6 +-
.../designer}/kamelet/KameletDefinitionsPanel.tsx | 6 +-
.../designer}/kamelet/KameletDependenciesCard.tsx | 4 +-
.../designer}/kamelet/KameletDesigner.tsx | 2 +-
.../integration/designer}/kamelet/KameletInput.tsx | 2 +-
.../designer}/kamelet/KameletTypesOutCard.tsx | 4 +-
.../integration/designer}/kamelet/kamelet.css | 0
.../features/integration/designer}/karavan.css | 0
.../designer}/property/DslProperties.css | 0
.../designer}/property/DslProperties.tsx | 8 +-
.../designer}/property/MainPropertiesPanel.tsx | 0
.../designer}/property/PropertiesHeader.tsx | 6 +-
.../designer}/property/PropertyStore.ts | 0
.../property/expression/ExpressionBottomPanel.tsx | 0
.../property/expression/ExpressionContextModel.tsx | 0
.../property/expression/ExpressionEditor.css | 0
.../property/expression/ExpressionEditor.tsx | 5 +-
.../designer}/property/property/BeanProperties.css | 0
.../designer}/property/property/BeanProperties.tsx | 6 +-
.../property/property/ComponentPropertyField.css | 0
.../property/property/ComponentPropertyField.tsx | 14 +-
.../property/ConfigurationSelectorModal.css | 0
.../property/ConfigurationSelectorModal.tsx | 2 +-
.../property/property/DataFormatField.tsx | 17 +-
.../property/property/DslPropertyField.css | 0
.../property/property/DslPropertyField.tsx | 32 +-
.../property/property/DslPropertyFieldSelect.tsx | 2 +-
.../property/DslPropertyFieldSelectScrollable.tsx | 2 +-
.../property/property/ExpressionField.tsx | 12 +-
.../property/property/FileReferenceDropdown.css | 0
.../property/property/FileReferenceDropdown.tsx | 0
.../property/property/KameletPropertyField.css | 0
.../property/property/KameletPropertyField.tsx | 4 +-
.../designer}/property/property/ObjectField.tsx | 10 +-
.../property/PropertyPlaceholderDropdown.css | 0
.../property/PropertyPlaceholderDropdown.tsx | 6 +-
.../designer}/property/property/PropertyUtil.tsx | 6 +-
.../property/property/VariablesDropdown.css | 0
.../property/property/VariablesDropdown.tsx | 2 +-
.../designer}/property/usePropertiesHook.tsx | 16 +-
.../integration/designer}/rest/RestCard.tsx | 6 +-
.../designer}/rest/RestConfigurationCard.tsx | 6 +-
.../integration/designer}/rest/RestDesigner.tsx | 29 +-
.../integration/designer}/rest/RestMethodCard.tsx | 4 +-
.../designer}/rest/RestMethodSelector.tsx | 0
.../features/integration/designer}/rest/rest.css | 0
.../designer}/route/DeleteConfirmation.tsx | 0
.../integration/designer}/route/DslConnections.css | 0
.../integration/designer}/route/DslConnections.tsx | 10 +-
.../integration/designer}/route/RouteDesigner.css | 0
.../integration/designer}/route/RouteDesigner.tsx | 0
.../designer}/route/element/DslElement.css | 0
.../designer}/route/element/DslElement.tsx | 6 +-
.../designer}/route/element/DslElementHeader.tsx | 12 +-
.../route/element/DslElementMoveModal.tsx | 2 +-
.../route/element/RouteTemplateElement.css | 0
.../route/element/RouteTemplateElement.tsx | 8 +-
.../designer}/route/useResizeObserver.tsx | 0
.../designer}/route/useRouteDesignerHook.tsx | 14 +-
.../integration/designer}/selector/DslCard.tsx | 14 +-
.../integration/designer}/selector/DslFastCard.tsx | 0
.../designer}/selector/DslPreferences.tsx | 0
.../integration/designer}/selector/DslSelector.css | 0
.../integration/designer}/selector/DslSelector.tsx | 10 +-
.../designer}/utils/CamelDefaultStepProperty.tsx | 0
.../integration/designer}/utils/CamelUi.tsx | 37 +-
.../integration/designer}/utils/DslMetaModel.ts | 0
.../integration/designer}/utils/ElementIcon.css | 0
.../integration/designer}/utils/ElementIcons.tsx | 0
.../integration/designer}/utils/EventBus.ts | 2 +-
.../designer}/utils/InfrastructureAPI.ts | 0
.../designer}/utils/IntegrationHeader.tsx | 0
.../integration/designer}/utils/MediaTypes.ts | 0
.../integration/designer}/utils/Notification.tsx | 2 +-
.../integration/designer}/utils/ValidatorUtils.ts | 0
.../features/integration}/developer/CodeEditor.tsx | 4 +-
.../features/integration}/developer/DataEditor.css | 0
.../integration}/developer/DesignerEditor.tsx | 26 +-
.../integration}/developer/DeveloperEditor.tsx | 20 +-
.../integration}/developer/DeveloperManager.css | 0
.../integration}/developer/DeveloperManager.tsx | 14 +-
.../integration}/developer/DeveloperToolbar.tsx | 6 +-
.../integration}/developer/EditorConfig.ts | 0
.../developer/EditorErrorBoundaryWrapper.tsx | 2 +-
.../integration}/developer/EditorOverlayWidget.css | 0
.../integration}/developer/EditorOverlayWidget.tsx | 0
.../integration/developer/EditorToolbar.tsx | 58 +
.../integration}/developer/MonacoEditorWrapper.tsx | 5 +-
.../developer/MonacoEditorWrapperStateless.tsx | 6 +-
.../{ => karavan/features}/integration/devmode.css | 0
.../integration/files/CreateFileModal.tsx | 23 +-
.../integration/files/CreateIntegrationModal.tsx | 24 +-
.../integration/files/DeleteFileModal.tsx | 6 +-
.../features}/integration/files/DiffFileModal.css | 0
.../features}/integration/files/DiffFileModal.tsx | 14 +-
.../features/integration/files}/FileComplexity.tsx | 10 +-
.../integration/files}/FileCopyForEnvModal.tsx | 8 +-
.../integration/files}/FilesTabWithComplexity.tsx | 45 +-
.../features}/integration/files/FilesToolbar.tsx | 10 +-
.../integration/files/UploadFileModal.tsx | 19 +-
.../integration/integration-build/BuildTab.tsx} | 26 +-
.../integration-containers}/ContainerButtons.tsx | 73 +-
.../ContainerEnvironmentPanel.tsx | 14 +-
.../integration-containers/ContainersTab.tsx | 34 +
.../integration-containers/ContainersTable.tsx | 54 +
.../integration-containers/ContainersTableRow.tsx | 73 +
.../integration-containers/ContainersToolbar.tsx} | 22 +-
.../integration-containers}/DeploymentButtons.tsx | 10 +-
.../integration-containers}/DeploymentPanel.tsx | 12 +-
.../integration-containers}/ImagesPanel.tsx | 212 +-
.../integration-containers/PodEventsLogTable.tsx | 61 +
.../CustomComponentFactory.tsx | 0
.../integration-topology/CustomEdge.tsx | 0
.../integration-topology/CustomGroup.tsx | 0
.../integration-topology/CustomNode.tsx | 20 +-
.../integration-topology/GetCustomMenu.tsx | 0
.../integration-topology/TopologyApi.tsx | 12 +-
.../integration-topology/TopologyBeans.css | 0
.../integration-topology/TopologyBeans.tsx | 16 +-
.../integration-topology/TopologyLegend.css | 0
.../integration-topology/TopologyLegend.tsx | 9 +-
.../integration-topology/TopologyStore.ts | 8 +-
.../integration-topology/TopologyTab.tsx | 21 +-
.../integration-topology}/TopologyToolbar.tsx | 58 +-
.../graph/TopologyDagreLayout.ts | 4 +-
.../integration-topology/graph/TopologyGroup.ts | 0
.../integration-topology/graph/TopologyLink.ts | 0
.../integration-topology/graph/TopologyNode.ts | 0
.../integration}/integration-topology/topology.css | 31 +-
.../integration-topology/useTopologyHook.tsx | 27 +-
.../features}/integration/readme/ReadmeTab.tsx | 2 +-
.../features/integration/toolbar/BuildToolbar.tsx} | 58 +-
.../integration/toolbar/DevModeToolbar.css} | 17 -
.../integration}/toolbar/DevModeToolbar.tsx | 54 +-
.../integration/toolbar/ProjectToolbar.tsx | 48 +
.../features}/integration/useProjectHook.tsx | 28 +-
.../features}/integrations/Complexity.css | 25 +-
.../features}/integrations/ComplexityApi.tsx | 4 +-
.../features}/integrations/ComplexityModels.ts | 0
.../features}/integrations/CreateProjectModal.tsx | 16 +-
.../features}/integrations/DeleteProjectModal.tsx | 6 +-
.../features/integrations/IntegrationsPage.tsx | 95 +
.../features/integrations/ProjectStatusLabel.tsx | 85 +
.../features}/integrations/ProjectZipApi.tsx | 4 +-
.../features/integrations/ProjectsTab.tsx} | 59 +-
.../features}/integrations/ProjectsTableRow.tsx | 27 +-
.../integrations/ProjectsTableRowActivity.tsx | 0
.../integrations/ProjectsTableRowComplexity.tsx | 0
.../features}/integrations/ProjectsToolbar.tsx | 16 +-
.../features/integrations/SettingsToolbar.tsx} | 47 +-
.../features}/integrations/UploadProjectModal.tsx | 6 +-
.../{ => karavan/features}/system/SystemPage.tsx | 68 +-
.../features/system/app-props}/AppPropsRow.tsx | 2 +-
.../features/system/app-props}/AppPropsTable.tsx | 2 +-
.../system/config-maps}/ConfigMapKeyModal.tsx | 6 +-
.../system/config-maps}/ConfigMapModal.tsx | 6 +-
.../features/system/config-maps}/ConfigMapRow.tsx | 8 +-
.../system/config-maps}/ConfigMapRowKey.tsx | 8 +-
.../system/config-maps}/ConfigMapsTable.tsx | 4 +-
.../features/system/containers}/ContainerPage.css | 0
.../system/containers}/ContainerTableRow.tsx | 85 +-
.../system/containers}/ContainersTable.tsx | 12 +-
.../system/deployments}/DeploymentStatusRow.tsx | 2 +-
.../deployments/DeploymentStatusesTable.tsx} | 40 +-
.../features/system/env-vars}/EnvVarRow.tsx | 2 +-
.../features/system/env-vars}/EnvVarsTable.tsx | 2 +-
.../features/system/secrets}/SecretKeyModal.tsx | 6 +-
.../features/system/secrets}/SecretModal.tsx | 6 +-
.../features/system/secrets}/SecretRow.tsx | 10 +-
.../features/system/secrets}/SecretRowKey.tsx | 8 +-
.../features/system/secrets}/SecretsTable.tsx | 4 +-
.../src/{access => karavan/models}/AccessModels.ts | 0
.../models}/DiagnosticsStore.ts | 0
.../src/{api => karavan/models}/ProjectModels.ts | 6 +-
.../src/{api => karavan/models}/SearchModels.ts | 0
.../src/{api => karavan/models}/ServiceModels.ts | 0
.../src/{system => karavan/models}/SystemModels.ts | 0
.../{access => karavan/services}/AccessService.ts | 4 +-
.../services}/NotificationService.ts | 6 +-
.../{api => karavan/services}/ProjectService.ts | 55 +-
.../{system => karavan/services}/SystemService.ts | 6 +-
.../src/{ => karavan/shared}/icons/SvgIcon.tsx | 2 +-
.../shared/icons/SvgNavigationIcon.tsx} | 13 +-
.../main/webui/src/karavan/shared/icons/access.svg | 6 +
.../webui/src/karavan/shared/icons/asyncapi.svg | 183 +
.../main/webui/src/karavan/shared/icons/camel.svg | 69 +
.../webui/src/{ => karavan/shared}/icons/class.svg | 0
.../src/{ => karavan/shared}/icons/config.svg | 0
.../src/karavan/shared/icons/container-run.svg | 11 +
.../webui/src/karavan/shared/icons/dashboard.svg | 6 +
.../webui/src/karavan/shared/icons/dashboardx.svg | 127 +
.../webui/src/{ => karavan/shared}/icons/db.svg | 0
.../{ => karavan/shared}/icons/dependencies.svg | 0
.../main/webui/src/karavan/shared/icons/docker.svg | 10 +
.../src/karavan/shared/icons/documentation.svg | 11 +
.../webui/src/{ => karavan/shared}/icons/git.svg | 0
.../src/{ => karavan/shared}/icons/groovy.svg | 0
.../src/{ => karavan/shared}/icons/groovy2.svg | 0
.../webui/src/{ => karavan/shared}/icons/icons.ts | 0
.../webui/src/{ => karavan/shared}/icons/ini.svg | 0
.../main/webui/src/karavan/shared/icons/jar.svg | 26 +
.../webui/src/karavan/shared/icons/json-schema.svg | 28 +
.../webui/src/{ => karavan/shared}/icons/json.svg | 0
.../src/{ => karavan/shared}/icons/light-db.svg | 0
.../src/{ => karavan/shared}/icons/light-json.svg | 0
.../src/{ => karavan/shared}/icons/light-yaml.svg | 0
.../main/webui/src/karavan/shared/icons/log.svg | 63 +
.../src/{ => karavan/shared}/icons/markdown.svg | 0
.../webui/src/{ => karavan/shared}/icons/maven.svg | 0
.../src/{ => karavan/shared}/icons/registry.svg | 0
.../src/{ => karavan/shared}/icons/source.svg | 0
.../webui/src/{ => karavan/shared}/icons/sql.svg | 0
.../webui/src/{ => karavan/shared}/icons/text.svg | 0
.../webui/src/{ => karavan/shared}/icons/xml.svg | 0
.../webui/src/{ => karavan/shared}/icons/xsl.svg | 0
.../webui/src/{ => karavan/shared}/icons/yaml.svg | 0
.../webui/src/{ => karavan/shared}/monaco-setup.ts | 0
.../src/karavan/shared/polling/PollingManager.ts | 57 +
.../src/karavan/shared/polling/useDataPolling.ts | 34 +
.../shared/ui}/ContainerButton.css | 0
.../shared/ui}/ContainerButton.tsx | 7 +-
.../shared/ui}/ErrorBoundaryWrapper.tsx | 0
.../shared/ui}/FieldSelectScrollable.tsx | 0
.../shared/ui}/FieldSelectWithCreate.tsx | 0
.../shared/ui}/MainToolbar.css | 8 +-
.../shared/ui}/MainToolbar.tsx | 0
.../shared/ui}/ModalConfirmation.tsx | 4 +-
.../shared/ui}/RightPanel.css | 2 +-
.../shared/ui}/RightPanel.tsx | 8 +-
.../src/{access => karavan/stores}/AccessStore.ts | 2 +-
.../developer => karavan/stores}/DeveloperStore.ts | 0
.../stores}/DocumentationStore.ts | 6 +-
.../src/{api => karavan/stores}/ProjectStore.ts | 65 +-
.../stores/ReadinessStore.ts} | 42 +-
.../src/{api => karavan/stores}/SearchStore.ts | 2 +-
.../src/{system => karavan/stores}/SystemStore.ts | 13 +-
.../main/webui/src/{ => karavan}/util/CodeUtils.ts | 20 +-
.../webui/src/{ => karavan}/util/ModalForm.css | 0
.../webui/src/{ => karavan}/util/StringUtils.ts | 0
.../webui/src/{ => karavan}/util/form-util.css | 0
.../webui/src/{ => karavan}/util/useFormUtil.tsx | 0
.../src/main/webui/src/main/EnvironmentLabel.tsx | 34 -
karavan-app/src/main/webui/src/main/Main.tsx | 71 -
karavan-app/src/main/webui/src/main/MainRoutes.tsx | 68 -
.../src/main/webui/src/main/NavigationMenu.tsx | 44 -
.../src/main/webui/src/main/ReadinessPanel.tsx | 18 -
.../src/main/webui/src/resources/ResourcesPage.tsx | 115 -
.../main/webui/src/resources/ResourcesTableRow.tsx | 78 -
karavan-app/src/main/webui/tsconfig.json | 13 +-
403 files changed, 23135 insertions(+), 4179 deletions(-)
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/KaravanStartupLoader.java b/karavan-app/src/main/java/org/apache/camel/karavan/KaravanStartupLoader.java
index c149a41d..81ad9458 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/KaravanStartupLoader.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/KaravanStartupLoader.java
@@ -122,6 +122,7 @@ public class KaravanStartupLoader implements HealthCheck {
addKameletsProject();
addBuildInProject(ProjectFolder.Type.templates.name());
addBuildInProject(ProjectFolder.Type.configuration.name());
+ addBuildInProject(ProjectFolder.Type.services.name());
addBuildInProject(ProjectFolder.Type.shared.name());
addBuildInProject(ProjectFolder.Type.documentation.name());
}
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/api/DevModeResource.java b/karavan-app/src/main/java/org/apache/camel/karavan/api/DevModeResource.java
index 53210a40..c444b8eb 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/api/DevModeResource.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/api/DevModeResource.java
@@ -25,7 +25,6 @@ import jakarta.ws.rs.core.Response;
import org.apache.camel.karavan.KaravanConstants;
import org.apache.camel.karavan.cache.KaravanCache;
import org.apache.camel.karavan.cache.PodContainerStatus;
-import org.apache.camel.karavan.cache.ProjectFolder;
import org.apache.camel.karavan.service.ProjectService;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jboss.logging.Logger;
@@ -52,14 +51,14 @@ public class DevModeResource {
@Inject
EventBus eventBus;
- @POST
+ @GET
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Authenticated
- @Path("/{verbose}/{compile}")
- public Response runProjectInDeveloperMode(ProjectFolder projectFolder, @PathParam("verbose") boolean verbose, @PathParam("compile") boolean compile) {
+ @Path("/run/{projectId}/{verbose}/{compile}")
+ public Response runProjectInDeveloperMode(@PathParam("projectId") String projectId, @PathParam("verbose") boolean verbose, @PathParam("compile") boolean compile) {
try {
- String containerName = projectService.runProjectInDeveloperMode(projectFolder.getProjectId(), verbose, compile, Map.of(), Map.of(), false);
+ String containerName = projectService.runProjectInDeveloperMode(projectId, verbose, compile, Map.of(), Map.of(), false);
if (containerName != null) {
return Response.ok(containerName).build();
} else {
@@ -72,12 +71,13 @@ public class DevModeResource {
}
}
- @POST
+ @GET
@Authenticated
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
- public Response runProjectInDeveloperMode(ProjectFolder projectFolder) throws Exception {
- return runProjectInDeveloperMode(projectFolder, false, false);
+ @Path("/run/{projectId}")
+ public Response runProjectInDeveloperMode(@PathParam("projectId") String projectId) throws Exception {
+ return runProjectInDeveloperMode(projectId, false, false);
}
@GET
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/api/ProjectFileResource.java b/karavan-app/src/main/java/org/apache/camel/karavan/api/ProjectFileResource.java
index 25094cc6..ed4944b1 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/api/ProjectFileResource.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/api/ProjectFileResource.java
@@ -44,10 +44,20 @@ public class ProjectFileResource {
@Authenticated
@Produces(MediaType.APPLICATION_JSON)
@Path("/{projectId}")
- public List<ProjectFile> get(@PathParam("projectId") String projectId) throws Exception {
- return karavanCache.getProjectFiles(projectId).stream()
- .sorted(Comparator.comparing(ProjectFile::getName))
- .collect(Collectors.toList());
+ public List<ProjectFile> getProjectFilesByName(@PathParam("projectId") String projectId, @QueryParam("filename") String filename) throws Exception {
+ if (filename == null) {
+ return karavanCache.getProjectFiles(projectId).stream()
+ .filter(Objects::nonNull)
+ .sorted(Comparator.comparing(ProjectFile::getName))
+ .collect(Collectors.toList());
+ } else {
+ var file = karavanCache.getProjectFile(projectId, filename);
+ if (file != null) {
+ return List.of(file);
+ } else {
+ return List.of();
+ }
+ }
}
@GET
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatus.java b/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatus.java
index df9e01c4..b461b6cd 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatus.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatus.java
@@ -17,7 +17,6 @@
package org.apache.camel.karavan.cache;
-import org.infinispan.api.annotations.indexing.Embedded;
import org.infinispan.api.annotations.indexing.Indexed;
import org.infinispan.api.annotations.indexing.Keyword;
import org.infinispan.protostream.annotations.ProtoFactory;
@@ -35,7 +34,6 @@ public class CamelStatus {
@Keyword(projectable = true, sortable = true)
@ProtoField(2)
String containerName;
- @Embedded
@ProtoField(value = 3, collectionImplementation = ArrayList.class)
List<CamelStatusValue> statuses;
@Keyword(projectable = true, sortable = true)
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatusValue.java b/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatusValue.java
index 9afb6d2d..57f9c45d 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatusValue.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/cache/CamelStatusValue.java
@@ -17,13 +17,10 @@
package org.apache.camel.karavan.cache;
-import org.infinispan.api.annotations.indexing.Indexed;
-import org.infinispan.api.annotations.indexing.Keyword;
import org.infinispan.protostream.annotations.ProtoEnumValue;
import org.infinispan.protostream.annotations.ProtoFactory;
import org.infinispan.protostream.annotations.ProtoField;
-@Indexed
public class CamelStatusValue {
public enum Name {
@@ -53,10 +50,8 @@ public class CamelStatusValue {
consumer
}
- @Keyword(projectable = true, sortable = true)
@ProtoField(1)
Name name;
- @Keyword(projectable = true, sortable = true)
@ProtoField(2)
String status;
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/docker/DockerEventHandler.java b/karavan-app/src/main/java/org/apache/camel/karavan/docker/DockerEventHandler.java
index 20a1b58b..71eed6c2 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/docker/DockerEventHandler.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/docker/DockerEventHandler.java
@@ -76,13 +76,13 @@ public class DockerEventHandler implements ResultCallback<Event> {
if ("exited".equalsIgnoreCase(container.getState())
&& Objects.equals(container.getLabels().get(LABEL_TYPE), ContainerType.build.name())) {
String tag = container.getLabels().get(LABEL_TAG);
- System.out.println(container);
syncImage(projectId, tag);
} else if ("running".equalsIgnoreCase(container.getState())
&& (
Objects.equals(container.getLabels().get(LABEL_TYPE), ContainerType.devmode.name())
|| Objects.equals(container.getLabels().get(LABEL_TYPE), ContainerType.build.name())
)
+ && event.getStatus() != null
&& !event.getStatus().startsWith("exec_")
&& !event.getStatus().startsWith("stop")
&& !event.getStatus().startsWith("kill")
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/listener/PodContainerStatusListener.java b/karavan-app/src/main/java/org/apache/camel/karavan/listener/PodContainerStatusListener.java
index d18c1401..c1a86e3f 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/listener/PodContainerStatusListener.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/listener/PodContainerStatusListener.java
@@ -50,7 +50,6 @@ public class PodContainerStatusListener {
try {
PodContainerStatus newStatus = data.mapTo(PodContainerStatus.class);
PodContainerStatus oldStatus = karavanCache.getPodContainerStatus(newStatus.getProjectId(), newStatus.getEnv(), newStatus.getContainerName());
-
if (oldStatus == null) {
karavanCache.savePodContainerStatus(newStatus);
} else if (Objects.equals(oldStatus.getInTransit(), Boolean.FALSE)) {
@@ -71,7 +70,7 @@ public class PodContainerStatusListener {
newStatus.setFinished(Instant.now().toString());
newStatus.setMemoryInfo("0MiB/0MiB");
newStatus.setCpuInfo("0%");
- } else if (Objects.nonNull(oldStatus.getFinished())) {
+ } else if (Objects.nonNull(oldStatus.getFinished()) && !oldStatus.getFinished().trim().isBlank()) {
return;
}
}
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/service/CodeService.java b/karavan-app/src/main/java/org/apache/camel/karavan/service/CodeService.java
index d189ff29..e478c880 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/service/CodeService.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/service/CodeService.java
@@ -58,8 +58,8 @@ public class CodeService {
private static final Logger LOGGER = Logger.getLogger(CodeService.class.getName());
public static final String APPLICATION_PROPERTIES_FILENAME = "application.properties";
public static final String BEAN_TEMPLATE_SUFFIX_FILENAME = "-bean-template.camel.yaml";
- public static final String DEV_SERVICES_FILENAME = "docker-compose.yaml";
public static final String PROJECT_COMPOSE_FILENAME = "docker-compose.yaml";
+ public static final String DEV_SERVICES_FILENAME = "docker-compose.yaml";
public static final String PROJECT_STACK_FILENAME = "docker-stack.yaml";
public static final String MARKDOWN_EXTENSION = ".md";
public static final String PROJECT_JKUBE_EXTENSION = ".jkube.yaml";
@@ -71,7 +71,10 @@ public class CodeService {
private static final String BUILDER_COMPOSE_FILENAME = "builder.docker-compose.yaml";
private static final String BUILDER_STACK_FILENAME = "builder.docker-stack.yaml";
public static final String BUILD_SCRIPT_FILENAME = "build.sh";
- public static final String CACHE_EXTENSION = ".json";
+ public static final String JSON_EXTENSION = ".json";
+ public static final String YAML_EXTENSION = ".yaml";
+ public static final String CAMEL_YAML_EXTENSION = ".camel.yaml";
+ public static final String COMPOSE_FILENAME_PREFIX= "docker-compose.";
@ConfigProperty(name = "karavan.environment", defaultValue = KaravanConstants.DEV)
String environment;
@@ -488,9 +491,9 @@ public class CodeService {
if (fileSystem != null) {
fileSystem.close();
}
- } catch (Exception e) {
+ } catch (URISyntaxException | IOException e) {
var error = e.getCause() != null ? e.getCause() : e;
- LOGGER.error("Exception", error);
+ LOGGER.error("URISyntaxException | IOException", error);
}
return result;
}
diff --git a/karavan-app/src/main/java/org/apache/camel/karavan/service/ComplexityService.java b/karavan-app/src/main/java/org/apache/camel/karavan/service/ComplexityService.java
index 05903215..e07704d8 100644
--- a/karavan-app/src/main/java/org/apache/camel/karavan/service/ComplexityService.java
+++ b/karavan-app/src/main/java/org/apache/camel/karavan/service/ComplexityService.java
@@ -6,6 +6,7 @@ import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;
import org.apache.camel.karavan.cache.KaravanCache;
import org.apache.camel.karavan.cache.ProjectFile;
+import org.apache.camel.karavan.cache.ProjectFolder;
import org.apache.camel.karavan.complexity.*;
import org.jboss.logging.Logger;
import org.yaml.snakeyaml.Yaml;
@@ -13,6 +14,7 @@ import org.yaml.snakeyaml.Yaml;
import java.util.*;
import static org.apache.camel.karavan.service.CodeService.APPLICATION_PROPERTIES_FILENAME;
+import static org.apache.camel.karavan.service.CodeService.CAMEL_YAML_EXTENSION;
@ApplicationScoped
public class ComplexityService {
@@ -77,7 +79,9 @@ public class ComplexityService {
}
public List<ComplexityProject> getProjectComplexities() {
- return karavanCache.getFolders().stream().map(project -> getProjectComplexity(project.getProjectId())).toList();
+ return karavanCache.getFolders().stream()
+ .filter(p -> Objects.equals(p.getType(), ProjectFolder.Type.integration))
+ .map(project -> getProjectComplexity(project.getProjectId())).toList();
}
public ComplexityProject getProjectComplexity(String projectId) {
@@ -93,7 +97,7 @@ public class ComplexityService {
complexityFile.setFileName(file.getName());
complexityFile.setChars(Long.valueOf(file.getCode().length()).intValue());
- if (file.getName().endsWith(".camel.yaml")) {
+ if (file.getName().endsWith(CAMEL_YAML_EXTENSION)) {
complexityFile.setType(ComplexityFile.Type.camel);
complexityFile.setBeans(getFileBeandCount(file.getCode()));
complexityFile.setRests(getFileRestCount(file.getCode()));
@@ -126,7 +130,7 @@ public class ComplexityService {
}
complexityProject.setRoutes(routes);
} catch (Exception e) {
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
}
return calculateComplexity(complexityProject);
}
@@ -364,7 +368,7 @@ public class ComplexityService {
return getStepsComplexity(complexity, steps);
}
} catch (Exception e) {
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
}
return complexity;
}
@@ -427,12 +431,15 @@ public class ComplexityService {
}
var otherwise = step.getJsonObject("otherwise");
if (otherwise != null) {
- complexity = getStepsComplexity(complexity, otherwise.getJsonArray("steps"));
+ var otherwiseSteps = otherwise.getJsonArray("steps");
+ if (otherwiseSteps != null) {
+ complexity = getStepsComplexity(complexity, otherwiseSteps);
+ }
}
}
}
} catch (Exception e) {
- LOGGER.error(e.getMessage());
+ LOGGER.error(e);
}
return complexity;
}
diff --git a/karavan-app/src/main/resources/templates/docker/application.properties b/karavan-app/src/main/resources/templates/docker/application.properties
index 37371a9d..5b6d9924 100644
--- a/karavan-app/src/main/resources/templates/docker/application.properties
+++ b/karavan-app/src/main/resources/templates/docker/application.properties
@@ -1,23 +1,32 @@
-camel.karavan.projectId=${projectId}
-camel.karavan.projectName=${projectName}
-camel.jbang.gav=org.camel.karavan.demo:${packageSuffix}:1
-camel.jbang.runtime=camel-main
-camel.jbang.dependencies=camel-console,camel-platform-http-main
-camel.jbang.jib-maven-plugin-version=3.4.4
-camel.server.enabled=true
-camel.server.healthCheckEnabled=true
-camel.server.devConsoleEnabled=true
camel.main.name=${projectId}
-camel.main.tracingStandby=true
-camel.trace.enabled=true
-camel.main.autoConfigurationFailFast=false
-camel.routecontroller.superviseEnabled=true
-camel.routecontroller.backoffDelay=5000
-camel.routecontroller.backoffMaxAttempts=100
-camel.routecontroller.initialDelay=1000
-camel.routecontroller.threadPoolSize=3
+camel.main.description=${projectName}
+camel.jbang.gav=org.apache.camel.karavan.demo:${projectId}:1
+camel.jbang.dependencies=camel-console
+camel.jbang.excludes=*.md
+camel.jbang.health=true
+camel.jbang.runtime=camel-main
camel.context.dev-console=true
camel.health.enabled=true
-camel.health.exposure-level=full
-jkube.version=1.18.1
+camel.health.exposureLevel=full
+camel.main.autoConfigurationFailFast=false
+camel.main.extraShutdownTimeout=1
+camel.main.logLanguage=groovy
+camel.main.shutdownTimeout=1
+camel.main.tracingStandby=true
+camel.metrics.enableMessageHistory=true
+camel.routecontroller.backOffDelay=5000
+camel.routecontroller.backOffMaxAttempts=100
+camel.routecontroller.initialDelay=1000
+camel.routecontroller.enabled=true
+camel.routecontroller.threadPoolSize=16
+camel.management.devConsoleEnabled=true
+camel.management.downloadEnabled=true
+camel.management.healthCheckEnabled=true
+camel.management.jolokiaEnabled=false
+camel.management.metricsEnabled=true
+camel.management.sendEnabled=true
+camel.server.enabled=true
+camel.trace.enabled=false
+camel.trace.standby=true
+jib.skip=false
jib.from.image=gcr.io/distroless/java21
diff --git a/karavan-app/src/main/resources/templates/kubernetes/application.properties b/karavan-app/src/main/resources/templates/kubernetes/application.properties
index 1c23c45c..a368df37 100644
--- a/karavan-app/src/main/resources/templates/kubernetes/application.properties
+++ b/karavan-app/src/main/resources/templates/kubernetes/application.properties
@@ -1,27 +1,37 @@
-camel.karavan.projectId=${projectId}
-camel.karavan.projectName=${projectName}
-camel.jbang.gav=org.camel.karavan.demo:${packageSuffix}:1
+camel.main.name=${projectId}
+camel.main.description=${projectName}
+camel.jbang.gav=org.apache.camel.karavan.demo:${projectId}:1
+camel.jbang.dependencies=camel-console
+camel.jbang.excludes=*.md
+camel.jbang.health=true
camel.jbang.runtime=camel-main
-camel.jbang.dependencies=camel-console,camel-platform-http-main
-camel.jbang.jib-maven-plugin-version=3.4.4
+camel.context.dev-console=true
camel.health.enabled=true
-camel.health.exposure-level=full
-camel.server.enabled=true
-camel.server.healthCheckEnabled=true
-camel.server.devConsoleEnabled=true
-camel.main.name=${projectId}
-camel.trace.enabled=true
-camel.main.tracingStandby=true
+camel.health.exposureLevel=full
camel.main.autoConfigurationFailFast=false
-camel.routecontroller.superviseEnabled=true
-camel.routecontroller.backoffDelay=5000
-camel.routecontroller.backoffMaxAttempts=100
+camel.main.extraShutdownTimeout=1
+camel.main.logLanguage=groovy
+camel.main.shutdownTimeout=1
+camel.main.tracingStandby=true
+camel.metrics.enableMessageHistory=true
+camel.routecontroller.backOffDelay=5000
+camel.routecontroller.backOffMaxAttempts=100
camel.routecontroller.initialDelay=1000
-camel.routecontroller.threadPoolSize=3
-camel.context.dev-console=true
-label.runtime=app.kubernetes.io/runtime
+camel.routecontroller.enabled=true
+camel.routecontroller.threadPoolSize=16
+camel.management.devConsoleEnabled=true
+camel.management.downloadEnabled=true
+camel.management.healthCheckEnabled=true
+camel.management.jolokiaEnabled=false
+camel.management.metricsEnabled=true
+camel.management.sendEnabled=true
+camel.server.enabled=true
+camel.trace.enabled=false
+camel.trace.standby=true
+jib.skip=false
jib.from.image=gcr.io/distroless/java21
#jib.from.image=gcr.io/distroless/java17-debian11:nonroot-arm64
+label.runtime=app.kubernetes.io/runtime
jkube.version=1.18.1
jkube.skip.build=true
jkube.imagePullPolicy=Always
diff --git a/karavan-app/src/main/webui/package-lock.json b/karavan-app/src/main/webui/package-lock.json
index 5d66819a..b9fcb3a2 100644
--- a/karavan-app/src/main/webui/package-lock.json
+++ b/karavan-app/src/main/webui/package-lock.json
@@ -28,8 +28,8 @@
"buffer": "6.0.3",
"file-saver": "2.0.5",
"javascript-time-ago": "2.5.12",
- "karavan-core": "file:../../../../karavan-core",
"keycloak-js": "26.2.1",
+ "lodash": "^4.17.21",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "7.65.0",
@@ -47,6 +47,8 @@
"@eslint/js": "9.33.0",
"@types/dagre": "0.7.53",
"@types/file-saver": "2.0.7",
+ "@types/js-yaml": "^4.0.9",
+ "@types/lodash": "^4.17.21",
"@types/react": "18.3.27",
"@types/react-dom": "18.3.1",
"@typescript-eslint/eslint-plugin": "8.39.1",
@@ -63,29 +65,6 @@
"vite-tsconfig-paths": "5.1.4"
}
},
- "../../../../karavan-core": {
- "version": "4.14.2",
- "license": "Apache-2.0",
- "dependencies": {
- "@types/js-yaml": "^4.0.9",
- "@types/uuid": "^10.0.0",
- "tsconfig-paths": "^4.2.0",
- "uuid": "10.0.0"
- },
- "devDependencies": {
- "@types/chai": "^4.3.16",
- "@types/dagre": "^0.7.52",
- "@types/mocha": "^10.0.7",
- "@types/node": "20.14.9",
- "chai": "^5.1.1",
- "cross-env": "^7.0.3",
- "fs": "^0.0.1-security",
- "mocha": "^10.5.2",
- "ts-node": "^10.9.2",
- "tsc-alias": "^1.8.10",
- "typescript": "4.9.5"
- }
- },
"node_modules/@babel/code-frame": {
"version": "7.27.1",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
@@ -398,9 +377,9 @@
}
},
"node_modules/@carbon/icon-helpers": {
- "version": "10.68.0",
- "resolved": "https://registry.npmjs.org/@carbon/icon-helpers/-/icon-helpers-10.68.0.tgz",
- "integrity": "sha512-fYor/Fs0RLtPMh2KRyPYR83JKoWbAmoQ7tCIW0QQcwYcIu82tvy7uT8vTNhda21w3uueOp70p6rYyY6vYjuRZA==",
+ "version": "10.69.0",
+ "resolved": "https://registry.npmjs.org/@carbon/icon-helpers/-/icon-helpers-10.69.0.tgz",
+ "integrity": "sha512-AYkP9+le5pLllM4OX1zHCSpBIX4uk8hzaV7EakyzQsUoWZIdLip0+j1n9WJvGA7EnMMaFxtmRkt1KAbSGi+YIg==",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
@@ -2432,6 +2411,7 @@
"version": "4.0.9",
"resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz",
"integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==",
+ "dev": true,
"license": "MIT"
},
"node_modules/@types/json-schema": {
@@ -2441,6 +2421,13 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/lodash": {
+ "version": "4.17.21",
+ "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.21.tgz",
+ "integrity": "sha512-FOvQ0YPD5NOfPgMzJihoT+Za5pdkDJWcbpuj1DjaKZIr/gxodQjY/uWEFlTNqW2ugXHUiL8lRQgw63dzKHZdeQ==",
+ "dev": true,
+ "license": "MIT"
+ },
"node_modules/@types/mdast": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
@@ -2962,9 +2949,9 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
- "version": "2.8.32",
- "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.32.tgz",
- "integrity": "sha512-OPz5aBThlyLFgxyhdwf/s2+8ab3OvT7AdTNvKHBwpXomIYeXqpUUuT8LrdtxZSsWJ4R4CU1un4XGh5Ez3nlTpw==",
+ "version": "2.9.4",
+ "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.4.tgz",
+ "integrity": "sha512-ZCQ9GEWl73BVm8bu5Fts8nt7MHdbt5vY9bP6WGnUh+r3l8M7CgfyTlwsgCbMC66BNxPr6Xoce3j66Ms5YUQTNA==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -3011,9 +2998,9 @@
}
},
"node_modules/browserslist": {
- "version": "4.28.0",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.0.tgz",
- "integrity": "sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==",
+ "version": "4.28.1",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.1.tgz",
+ "integrity": "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA==",
"dev": true,
"funding": [
{
@@ -3031,11 +3018,11 @@
],
"license": "MIT",
"dependencies": {
- "baseline-browser-mapping": "^2.8.25",
- "caniuse-lite": "^1.0.30001754",
- "electron-to-chromium": "^1.5.249",
+ "baseline-browser-mapping": "^2.9.0",
+ "caniuse-lite": "^1.0.30001759",
+ "electron-to-chromium": "^1.5.263",
"node-releases": "^2.0.27",
- "update-browserslist-db": "^1.1.4"
+ "update-browserslist-db": "^1.2.0"
},
"bin": {
"browserslist": "cli.js"
@@ -3118,9 +3105,9 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001757",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001757.tgz",
- "integrity": "sha512-r0nnL/I28Zi/yjk1el6ilj27tKcdjLsNqAOZr0yVjWPrSQyHgKI2INaEWw21bAQSv2LXRt1XuCS/GomNpWOxsQ==",
+ "version": "1.0.30001759",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001759.tgz",
+ "integrity": "sha512-Pzfx9fOKoKvevQf8oCXoyNRQ5QyxJj+3O0Rqx2V5oxT61KGx8+n6hV/IUyJeifUci2clnmmKVpvtiqRzgiWjSw==",
"dev": true,
"funding": [
{
@@ -3933,9 +3920,9 @@
}
},
"node_modules/electron-to-chromium": {
- "version": "1.5.262",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.262.tgz",
- "integrity": "sha512-NlAsMteRHek05jRUxUR0a5jpjYq9ykk6+kO0yRaMi5moe7u0fVIOeQ3Y30A8dIiWFBNUoQGi1ljb1i5VtS9WQQ==",
+ "version": "1.5.266",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.266.tgz",
+ "integrity": "sha512-kgWEglXvkEfMH7rxP5OSZZwnaDWT7J9EoZCujhnpLbfi0bbNtRkgdX2E3gt0Uer11c61qCYktB3hwkAS325sJg==",
"dev": true,
"license": "ISC"
},
@@ -5006,15 +4993,15 @@
}
},
"node_modules/hast-util-to-parse5": {
- "version": "8.0.0",
- "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz",
- "integrity": "sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==",
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz",
+ "integrity": "sha512-MlWT6Pjt4CG9lFCjiz4BH7l9wmrMkfkJYCxFwKQic8+RTZgWPuWxwAfjJElsXkex7DJjfSJsQIt931ilUgmwdA==",
"license": "MIT",
"dependencies": {
"@types/hast": "^3.0.0",
"comma-separated-tokens": "^2.0.0",
"devlop": "^1.0.0",
- "property-information": "^6.0.0",
+ "property-information": "^7.0.0",
"space-separated-tokens": "^2.0.0",
"web-namespaces": "^2.0.0",
"zwitch": "^2.0.0"
@@ -5024,16 +5011,6 @@
"url": "https://opencollective.com/unified"
}
},
- "node_modules/hast-util-to-parse5/node_modules/property-information": {
- "version": "6.5.0",
- "resolved": "https://registry.npmjs.org/property-information/-/property-information-6.5.0.tgz",
- "integrity": "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==",
- "license": "MIT",
- "funding": {
- "type": "github",
- "url": "https://github.com/sponsors/wooorm"
- }
- },
"node_modules/hast-util-to-string": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz",
@@ -5482,10 +5459,6 @@
"node": ">=6"
}
},
- "node_modules/karavan-core": {
- "resolved": "../../../../karavan-core",
- "link": true
- },
"node_modules/keycloak-js": {
"version": "26.2.1",
"resolved": "https://registry.npmjs.org/keycloak-js/-/keycloak-js-26.2.1.tgz",
@@ -8453,9 +8426,9 @@
}
},
"node_modules/update-browserslist-db": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz",
- "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==",
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.2.tgz",
+ "integrity": "sha512-E85pfNzMQ9jpKkA7+TJAi4TJN+tBCuWh5rUcS/sv6cFi+1q9LYDwDI5dpUL0u/73EElyQ8d3TEaeW4sPedBqYA==",
"dev": true,
"funding": [
{
diff --git a/karavan-app/src/main/webui/package.json b/karavan-app/src/main/webui/package.json
index 13ebbb9f..95fc6682 100644
--- a/karavan-app/src/main/webui/package.json
+++ b/karavan-app/src/main/webui/package.json
@@ -47,8 +47,8 @@
"buffer": "6.0.3",
"file-saver": "2.0.5",
"javascript-time-ago": "2.5.12",
- "karavan-core": "file:../../../../karavan-core",
"keycloak-js": "26.2.1",
+ "lodash": "^4.17.21",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "7.65.0",
@@ -66,6 +66,8 @@
"@eslint/js": "9.33.0",
"@types/dagre": "0.7.53",
"@types/file-saver": "2.0.7",
+ "@types/js-yaml": "^4.0.9",
+ "@types/lodash": "^4.17.21",
"@types/react": "18.3.27",
"@types/react-dom": "18.3.1",
"@typescript-eslint/eslint-plugin": "8.39.1",
diff --git a/karavan-app/src/main/webui/src/accelerator/context/ProjectContainersContextProvider.tsx b/karavan-app/src/main/webui/src/accelerator/context/ProjectContainersContextProvider.tsx
deleted file mode 100644
index fed449fc..00000000
--- a/karavan-app/src/main/webui/src/accelerator/context/ProjectContainersContextProvider.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import React from 'react';
-import {useAppConfigStore, useProjectStore, useStatusesStore} from "@/api/ProjectStore";
-import {shallow} from "zustand/shallow";
-import {ContainerStatus} from "@/api/ProjectModels";
-
-type ProjectContainersContextType = {
- containerStatuses: ContainerStatus[]
- packagedContainerStatuses: ContainerStatus[]
- devModeContainerStatus?: ContainerStatus
- devModeIsRunning: boolean;
- packagedIsRunning: boolean;
- origin: string;
-};
-
-export const ProjectContainersContext = React.createContext<ProjectContainersContextType | undefined>(undefined);
-
-type ProjectContainersContextEnvelopeProps = {
- children: React.ReactNode
-};
-
-export function ProjectContainersContextProvider({children}: ProjectContainersContextEnvelopeProps) {
-
- const [config] = useAppConfigStore((s) => [s.config], shallow);
- const [project] = useProjectStore((s) => [s.project], shallow);
- const [containers] = useStatusesStore((s) => [s.containers], shallow);
-
- const containerStatuses = containers.filter(c => c.projectId === project.projectId) || [];
- const packagedContainerStatuses = containerStatuses.filter(c => c.type === 'packaged') || [];
- const isProjectContainer = packagedContainerStatuses.length > 0;
- const packagedIsRunning = isProjectContainer && (packagedContainerStatuses.filter(c => c.state === 'running').length === packagedContainerStatuses.length);
-
- const devModeContainerStatus = containerStatuses.filter(c => c.type === 'devmode').at(0);
- const devModeIsRunning = devModeContainerStatus?.state === 'running';
-
- const isKubernetes = config.infrastructure === 'kubernetes'
-
- const runningContainer = devModeIsRunning ? devModeContainerStatus : packagedContainerStatuses.find(c => c.state === 'running');
-
- const origin = 'http://' + (isKubernetes
- ? runningContainer?.podId + ':8080'
- : runningContainer?.containerName + ':8080'
- );
-
- return (
- <ProjectContainersContext.Provider value={{containerStatuses, packagedContainerStatuses, devModeContainerStatus, devModeIsRunning, packagedIsRunning, origin}}>
- {children}
- </ProjectContainersContext.Provider>
- );
-}
diff --git a/karavan-app/src/main/webui/src/accelerator/developer/EditorToolbar.tsx b/karavan-app/src/main/webui/src/accelerator/developer/EditorToolbar.tsx
deleted file mode 100644
index 9470c5cc..00000000
--- a/karavan-app/src/main/webui/src/accelerator/developer/EditorToolbar.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import React, {useEffect} from 'react';
-import {Button, Flex, FlexItem, Tooltip,} from '@patternfly/react-core';
-import '@/integration-designer/karavan.css';
-import {useAppConfigStore, useFileStore, useProjectStore} from "@/api/ProjectStore";
-import {shallow} from "zustand/shallow";
-import {KaravanApi} from "@/api/KaravanApi";
-import ShareIcon from "@patternfly/react-icons/dist/esm/icons/share-alt-icon";
-import {BUILD_IN_PROJECTS, ProjectType} from "@/api/ProjectModels";
-import {ProjectContainersContextProvider} from "@/accelerator/context/ProjectContainersContextProvider";
-
-export function EditorToolbar() {
-
- const {config} = useAppConfigStore();
- const [project, tabIndex] = useProjectStore((s) => [s.project, s.tabIndex], shallow)
- const [file] = useFileStore((state) => [state.file], shallow)
-
- const isBuildInProject = BUILD_IN_PROJECTS.includes(project.projectId);
- const isConfiguration = project.projectId === ProjectType.configuration.toString();
- const isKubernetes = config.infrastructure === 'kubernetes'
- const tooltip = isKubernetes ? "Save as Configmaps" : "Save on shared volume";
-
- useEffect(() => {
- }, [project, file]);
-
- function shareConfigurationFile () {
- if (file) {
- KaravanApi.shareConfigurationFile(file?.name, res => {})
- }
- }
-
- function isRunnable(): boolean {
- return !isBuildInProject && !['build', 'container'].includes(tabIndex.toString());
- }
-
- return (
- <div id="toolbar-group-types">
- <Flex className="" direction={{default: "row"}} justifyContent={{default: 'justifyContentSpaceBetween'}} alignItems={{default: "alignItemsCenter"}}>
- {isConfiguration && <FlexItem>
- <Tooltip content={tooltip} position={"bottom-end"}>
- <Button className="dev-action-button" size="sm" variant={"primary"} icon={<ShareIcon/>}
- onClick={e => shareConfigurationFile()}
- >
- Share
- </Button>
- </Tooltip>
- </FlexItem>}
- </Flex>
- </div>
- )
-}
diff --git a/karavan-app/src/main/webui/src/accelerator/toolbar/DevModeToolbar.css b/karavan-app/src/main/webui/src/accelerator/toolbar/DevModeToolbar.css
deleted file mode 100644
index c368f8e3..00000000
--- a/karavan-app/src/main/webui/src/accelerator/toolbar/DevModeToolbar.css
+++ /dev/null
@@ -1,60 +0,0 @@
-
-.karavan .refresher {
- width: 34px;
- height: 34px;
-}
-
-.karavan .refresher .spinner {
- position: absolute;
- width: 34px;
- height: 34px;
-}
-
-.karavan .refresher .button {
- position: absolute;
- width: 34px;
- height: 34px;
- padding: 0;
- font-size: 16px;
-}
-
-.karavan .refresher .button .pf-v6-c-button__icon {
- margin: 0;
-}
-
-.karavan .main-toolbar {
- display: flex;
- flex-direction: row;
- align-items: center;
- gap: 8px;
-}
-
-.karavan .main-toolbar .main-run-button .pf-v6-svg {
- margin-right: 5px;
-}
-
-.karavan .main-toolbar .main-run-dropdown-toggle .pf-v6-c-menu-toggle__button:last-child {
- padding-left: 0;
- padding-right: 0;
-}
-
-.karavan .main-toolbar .try-out-button {
- display: flex;
- flex-direction: row;
- align-items: center;
-}
-
-.karavan .main-toolbar .try-out-button .pf-v6-c-button__icon {
- display: flex;
- flex-direction: row;
- align-items: center;
-}
-
-.karavan .main-toolbar .pf-m-disabled .tryout-icon {
- opacity: 0.5;
-}
-.karavan .main-toolbar .tryout-icon {
- width: 1.4em;
- height: 1.4em;
- line-height: 1.4em;
-}
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/accelerator/toolbar/ProjectToolbar.tsx b/karavan-app/src/main/webui/src/accelerator/toolbar/ProjectToolbar.tsx
deleted file mode 100644
index 0dc8c7b1..00000000
--- a/karavan-app/src/main/webui/src/accelerator/toolbar/ProjectToolbar.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import React, {useEffect} from 'react';
-import {DevModeToolbar} from "./DevModeToolbar";
-import {ResourceToolbar} from "./ResourceToolbar";
-import {useAppConfigStore, useFileStore, useProjectStore} from "@/api/ProjectStore";
-import {shallow} from "zustand/shallow";
-import {EditorToolbar} from "@/accelerator/developer/EditorToolbar";
-import {BUILD_IN_PROJECTS} from "@/api/ProjectModels";
-import {FileSearchToolbarItem} from "@/integration/FileSearchToolbarItem";
-import {ProjectContainersContextProvider} from "../context/ProjectContainersContextProvider";
-
-export function ProjectToolbar() {
-
- const [project] = useProjectStore((s) => [s.project, s.tabIndex], shallow)
- const [file, operation] = useFileStore((state) => [state.file, state.operation], shallow)
- const [config] = useAppConfigStore((s) => [s.config], shallow);
- const isDev = config.environment === 'dev';
-
- const isBuildInProject = BUILD_IN_PROJECTS.includes(project.projectId);
-
- useEffect(() => {
- }, [project, file]);
-
- function isFile(): boolean {
- return file !== undefined && operation !== 'delete';
- }
-
- function getProjectToolbar() {
- return (
- <div id="toolbar-group-types" className='main-toolbar-toolbar'>
- <FileSearchToolbarItem/>
- {!isBuildInProject && isDev &&
- <ProjectContainersContextProvider>
- <DevModeToolbar/>
- </ProjectContainersContextProvider>
- }
- {(isBuildInProject || !isDev) && <ResourceToolbar/>}
- </div>
- )
- }
-
- return isFile() ? <EditorToolbar/> : getProjectToolbar();
-}
diff --git a/karavan-app/src/main/webui/src/accelerator/toolbar/ProjectsToolbarAccelerator.tsx b/karavan-app/src/main/webui/src/accelerator/toolbar/ProjectsToolbarAccelerator.tsx
deleted file mode 100644
index f2b4e271..00000000
--- a/karavan-app/src/main/webui/src/accelerator/toolbar/ProjectsToolbarAccelerator.tsx
+++ /dev/null
@@ -1,9 +0,0 @@
-import React from 'react';
-
-export function ProjectsToolbarAccelerator() {
-
- return (
- <>
- </>
- )
-}
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/accelerator/utils/FileUtils.ts b/karavan-app/src/main/webui/src/accelerator/utils/FileUtils.ts
deleted file mode 100644
index f77bd532..00000000
--- a/karavan-app/src/main/webui/src/accelerator/utils/FileUtils.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-export const GROOVY_FILE_PREFIX = {
- TRANSFORMATIONS: 'tr',
- DATA_MODELS: 'dm',
- FUNCTIONS: 'fn',
- CLASS: 'cl',
- SCRIPT: 'sc',
-} as const;
-
-export type Kind = keyof typeof GROOVY_FILE_PREFIX;
-
-function toPascalCase(input: string): string {
- return input
- .replace(/(^|_|-|\s)+(.)/g, (_, __, c) => c.toUpperCase());
-}
-
-export function generateGroovyFilename(kind: Kind, name: string): string {
- switch (kind) {
- case 'CLASS':
- return toPascalCase(name) + '.groovy'; // e.g., order_service -> OrderService.groovy
- case 'TRANSFORMATIONS':
- return `${GROOVY_FILE_PREFIX.TRANSFORMATIONS}_${name}.groovy`;
- case 'FUNCTIONS':
- return `${GROOVY_FILE_PREFIX.FUNCTIONS}_${name}.groovy`;
- case 'DATA_MODELS':
- return `${GROOVY_FILE_PREFIX.DATA_MODELS}_${name}.groovy`;
- case 'SCRIPT':
- return `${GROOVY_FILE_PREFIX.SCRIPT}_${name}.groovy`;
- default:
- throw new Error(`Unknown kind: ${kind}`);
- }
-}
diff --git a/karavan-app/src/main/webui/src/diagnostics/ContainerStatusRow.tsx b/karavan-app/src/main/webui/src/diagnostics/ContainerStatusRow.tsx
deleted file mode 100644
index 07bd1e19..00000000
--- a/karavan-app/src/main/webui/src/diagnostics/ContainerStatusRow.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, {useState} from 'react';
-import {Badge, CodeBlock, CodeBlockCode, Label,} from '@patternfly/react-core';
-import {Tbody, Td, Tr} from '@patternfly/react-table';
-import {ContainerStatus} from "@/api/ProjectModels";
-
-export interface Props {
- index: number
- container: ContainerStatus
-}
-
-export function ContainerStatusRow(props: Props) {
-
- const [isExpanded, setIsExpanded] = useState<boolean>(false);
-
- const {index, container} = props;
- const isRunning = container.state === 'running';
- const color = isRunning ? "green" : "grey";
- return (
- <Tbody>
- <Tr key={container.projectId + ':' + index} className='camelstatus-data'>
- <Td noPadding isActionCell expand={{
- rowIndex: props.index,
- isExpanded: isExpanded,
- onToggle: () => setIsExpanded(!isExpanded),
- expandId: 'composable-expandable-example'
- }} modifier={"fitContent"}/>
- <Td noPadding modifier={"fitContent"}>
- {container.containerName}
- </Td>
- <Td noPadding modifier={"wrap"}>
- {container.containerId}
- </Td>
- <Td noPadding modifier={"fitContent"}>
- <Badge> {container.type}</Badge>
- </Td>
- <Td noPadding modifier={"fitContent"}>
- <Label color={color}>{container.state}</Label>
- </Td>
- <Td noPadding modifier={"fitContent"}>
- <Label color={color}>{container.env}</Label>
- </Td>
- </Tr>
- <Tr isExpanded={isExpanded} className='fields-data'>
- <Td/>
- <Td colSpan={5} modifier={"fitContent"}>
- <CodeBlock>
- <CodeBlockCode id="code-content">{JSON.stringify(container, null, 2)}</CodeBlockCode>
- </CodeBlock>
- </Td>
- </Tr>
- </Tbody>
- )
-}
diff --git a/karavan-app/src/main/webui/src/diagnostics/ContainerStatusesTable.tsx b/karavan-app/src/main/webui/src/diagnostics/ContainerStatusesTable.tsx
deleted file mode 100644
index 0b9170c6..00000000
--- a/karavan-app/src/main/webui/src/diagnostics/ContainerStatusesTable.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import React, {useEffect} from 'react';
-import {Bullseye, EmptyState, Spinner} from '@patternfly/react-core';
-import {InnerScrollContainer, OuterScrollContainer, Table, Td, Th, Thead, Tr} from '@patternfly/react-table';
-import {shallow} from "zustand/shallow";
-import {useStatusesStore} from "@/api/ProjectStore";
-import {ContainerStatusRow} from "./ContainerStatusRow";
-
-export function ContainerStatusesTable() {
-
- const [containers] = useStatusesStore((state) => [state.containers], shallow);
-
- useEffect(() => {
- }, []);
-
- function getTableBody() {
- return (
- containers.map((container, index) => (
- <ContainerStatusRow key={index} index={index} container={container}/>
- ))
- )
- }
-
- function getTableEmpty() {
- return (
- <Tr>
- <Td colSpan={15}>
- <Bullseye>
- <EmptyState icon={Spinner}/>
- </Bullseye>
- </Td>
- </Tr>
- )
- }
-
- return (
- <OuterScrollContainer>
- <InnerScrollContainer>
- <Table variant='compact' borders={false} isStickyHeader>
- <Thead>
- <Tr>
- <Th/>
- <Th key='name'>Container Name</Th>
- <Th key='id'>Container Id</Th>
- <Th key='type'>Type</Th>
- <Th key='state'>State</Th>
- <Th key='environment' modifier={"fitContent"}>Environment</Th>
- </Tr>
- </Thead>
- {containers && containers.length > 0 ? getTableBody() : getTableEmpty()}
- </Table>
- </InnerScrollContainer>
- </OuterScrollContainer>
- )
-}
diff --git a/karavan-app/src/main/webui/src/diagnostics/DeploymentStatusesTable.tsx b/karavan-app/src/main/webui/src/diagnostics/DeploymentStatusesTable.tsx
deleted file mode 100644
index a3c1543c..00000000
--- a/karavan-app/src/main/webui/src/diagnostics/DeploymentStatusesTable.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import React, {useEffect} from 'react';
-import {Bullseye, EmptyState, Spinner,} from '@patternfly/react-core';
-import {InnerScrollContainer, OuterScrollContainer, Table, Td, Th, Thead, Tr} from '@patternfly/react-table';
-import {shallow} from "zustand/shallow";
-import {useStatusesStore} from "@/api/ProjectStore";
-import {DeploymentStatusRow} from "./DeploymentStatusRow";
-
-export function DeploymentStatusesTable() {
-
- const [deployments] = useStatusesStore((state) => [state.deployments], shallow);
-
- useEffect(() => {
- }, []);
-
- function getTableBody() {
- return (
- deployments.map((deployment, index) => (
- <DeploymentStatusRow key={index} index={index} deployment={deployment}/>
- ))
- )
- }
-
- function getTableEmpty() {
- return (
- <Tr>
- <Td colSpan={15}>
- <Bullseye>
- <EmptyState icon={Spinner}/>
- </Bullseye>
- </Td>
- </Tr>
- )
- }
-
- return (
- <OuterScrollContainer>
- <InnerScrollContainer>
- <Table variant='compact' borders={false} isStickyHeader>
- <Thead>
- <Tr>
- <Th/>
- <Th key='name' modifier={"fitContent"}>Deployment Name</Th>
- <Th key='id'>Image</Th>
- <Th key='type' modifier={"fitContent"}>Environment</Th>
- <Th key='state' modifier={"fitContent"}>Namespace</Th>
- </Tr>
- </Thead>
- {deployments && deployments.length > 0 ? getTableBody() : getTableEmpty()}
- </Table>
- </InnerScrollContainer>
- </OuterScrollContainer>
- )
-}
diff --git a/karavan-app/src/main/webui/src/diagnostics/DiagnosticsPage.tsx b/karavan-app/src/main/webui/src/diagnostics/DiagnosticsPage.tsx
deleted file mode 100644
index dbfa775a..00000000
--- a/karavan-app/src/main/webui/src/diagnostics/DiagnosticsPage.tsx
+++ /dev/null
@@ -1,158 +0,0 @@
-import React, {useEffect, useState} from 'react';
-import {
- Button,
- capitalize,
- Content,
- Nav,
- NavItem,
- NavList,
- Switch,
- TextInputGroup,
- TextInputGroupMain,
- TextInputGroupUtilities,
- Tooltip,
- TooltipPosition
-} from '@patternfly/react-core';
-import {KaravanApi} from "@/api/KaravanApi";
-import {EventBus} from "@/integration-designer/utils/EventBus";
-import RefreshIcon from "@patternfly/react-icons/dist/esm/icons/sync-alt-icon";
-import {CamelStatusesTable} from "./CamelStatusesTable";
-import {ProjectService} from "@/api/ProjectService";
-import {DiagnosticsApi} from "./DiagnosticsApi";
-import {useAppConfigStore, useStatusesStore} from "@/api/ProjectStore";
-import {shallow} from "zustand/shallow";
-import {RightPanel} from "@/components/RightPanel";
-import {ContainerStatusesTable} from "@/diagnostics/ContainerStatusesTable";
-import {DeploymentStatusesTable} from "@/diagnostics/DeploymentStatusesTable";
-import {useDiagnosticsStore} from "@/diagnostics/DiagnosticsStore";
-import {EnvVarsTable} from "@/diagnostics/EnvVarsTable";
-import {AppPropsTable} from "@/diagnostics/AppPropsTable";
-import TimesIcon from "@patternfly/react-icons/dist/esm/icons/times-icon";
-
-export const DiagnosticsPage = () => {
-
- const [config] = useAppConfigStore((state) => [state.config], shallow)
- const [setEnvVars, setAppProps, filter, setFilter] = useDiagnosticsStore((state) => [state.setEnvVars, state.setAppProps, state.filter, state.setFilter], shallow)
- const isKubernetes = config.infrastructure === 'kubernetes'
- const [autoRefresh, setAutoRefresh] = useState<boolean>(false);
- const [tab, setTab] = useState<string | number>("camel");
- const [setCamels] = useStatusesStore((state) => [state.setCamelContexts], shallow);
-
- function refresh() {
- ProjectService.refreshAllContainerStatuses();
- ProjectService.refreshAllDeploymentStatuses();
- DiagnosticsApi.getAllCamelStatuses(statuses => {
- setCamels(statuses);
- })
- DiagnosticsApi.getEnvVars((envVars: string[]) => {
- setEnvVars(envVars.sort((a, b) => a.localeCompare(b)));
- });
- DiagnosticsApi.getAppProps((appProps: string[]) => {
- setAppProps(appProps.sort((a, b) => a.localeCompare(b)));
- });
- }
-
- useEffect(() => {
- refresh()
- }, []);
-
- useEffect(() => {
- const interval = setInterval(() => {
- if (autoRefresh) {
- refresh();
- }
- }, 2000)
- return () => clearInterval(interval);
- }, [autoRefresh]);
-
- function filterToolbar() {
- return (
- <TextInputGroup className="search">
- <TextInputGroupMain
- value={filter}
- placeholder='Search by name'
- type="text"
- autoComplete={"off"}
- autoFocus={true}
- onChange={(_event, value) => {
- setFilter(value);
- }}
- aria-label="text input example"
- />
- <TextInputGroupUtilities>
- <Button variant="plain" onClick={_ => {
- setFilter('');
- }}>
- <TimesIcon aria-hidden={true}/>
- </Button>
- </TextInputGroupUtilities>
- </TextInputGroup>
- )
- }
-
- function statusesToolbar() {
- return (
- <div style={{display: "flex", flexDirection: "row", gap: "8px", alignItems: "center"}}>
- <Tooltip content={'Auto Refresh'} position={TooltipPosition.left}>
- <Switch checked={autoRefresh} onChange={(_, e) => setAutoRefresh(e)}/>
- </Tooltip>
- <Button icon={<RefreshIcon/>} variant='link' onClick={refresh}/>
- <Button className="dev-action-button" onClick={event => {
- KaravanApi.deleteAllStatuses(res => {
- if (res.status === 200) {
- EventBus.sendAlert('Success', 'Statuses deleted', "info");
- KaravanApi.restartInformers(res1 => {
- if (res1.status === 200) {
- EventBus.sendAlert('Success', 'Informers restarted', "info");
- }
- })
- }
- })
- }}>
- Cleanup statuses
- </Button>
- </div>
- );
- }
-
- function title() {
- return (<Content component="h2">Diagnostic</Content>);
- }
-
- const showFilterToolbar = ['envVars', 'appProps'].includes(tab?.toString());
-
- function getNavigation() {
- const list = isKubernetes
- ? ['camel', 'containers', 'deployment', 'envVars', 'appProps']
- : ['camel', 'containers', 'envVars', 'appProps'];
- return (
- <Nav onSelect={(_, selectedItem) => setTab(selectedItem.itemId)}
- aria-label="Nav" variant="horizontal">
- <NavList>
- {list.map((item, i) =>
- <NavItem key={item} preventDefault itemId={item} isActive={tab === item} to="#">
- {capitalize(item)}
- </NavItem>
- )}
- </NavList>
- </Nav>
- )
- }
-
- return (
- <RightPanel
- title={title()}
- toolsStart={getNavigation()}
- tools={showFilterToolbar ? filterToolbar() : statusesToolbar()}
- mainPanel={
- <div className="right-panel-card">
- {tab === 'camel' && <CamelStatusesTable/>}
- {tab === 'containers' && <ContainerStatusesTable/>}
- {tab === 'deployment' && <DeploymentStatusesTable/>}
- {tab === 'envVars' && <EnvVarsTable/>}
- {tab === 'appProps' && <AppPropsTable/>}
- </div>
- }
- />
- )
-}
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/icons/docker.svg b/karavan-app/src/main/webui/src/icons/docker.svg
deleted file mode 100644
index bb862a50..00000000
--- a/karavan-app/src/main/webui/src/icons/docker.svg
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
-<svg width="800px" height="800px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>file_type_docker2</title><path d="M16.54,12.663H19.4v2.924h1.446a6.272,6.272,0,0,0,1.988-.333,5.091,5.091,0,0,0,.966-.436,3.584,3.584,0,0,1-.67-1.849,3.907,3.907,0,0,1,.7-2.753l.3-.348.358.288a4.558,4.558,0,0,1,1.795,2.892,4.375,4.375,0,0,1,3.319.309l.393.226-.207.4a4.141,4.141,0,0,1-4.157,1.983c-2.48,6.168-7.871,9.088-14.409,9.088-3.378,0-6.476-1.263-8.241-4.259l-.029-.049L2.7,20.227a8.316,8. [...]
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/icons/jar.svg b/karavan-app/src/main/webui/src/icons/jar.svg
deleted file mode 100644
index 4ae009d7..00000000
--- a/karavan-app/src/main/webui/src/icons/jar.svg
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
-<svg width="800px" height="800px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>file_type_jar</title><path d="M12.7,23.56s-1.07.622.761.833a16.023,16.023,0,0,0,5.8-.246A10.088,10.088,0,0,0,20.8,24.9c-5.481,2.349-12.405-.136-8.1-1.339" style="fill:#5382a1"/><path d="M12.026,20.494s-1.2.888.633,1.078a22.618,22.618,0,0,0,7.481-.359,3.32,3.32,0,0,0,1.152.7c-6.627,1.938-14.009.153-9.266-1.421" style="fill:#5382a1"/><path d="M17.673,15.294a2.051,2.051,0,0,1-.355,2.954s3.429-1.7 [...]
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/icons/log.svg b/karavan-app/src/main/webui/src/icons/log.svg
deleted file mode 100644
index 52d186fe..00000000
--- a/karavan-app/src/main/webui/src/icons/log.svg
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
-<svg width="800px" height="800px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>file_type_log</title><path d="M29.4,27.6H2.5V4.5H29.4Zm-25.9-1H28.4V5.5H3.5Z" style="fill:#00bd02"/><rect x="2.5" y="5.5" width="26.9" height="1.9" style="fill:#00bd02"/><rect x="11.333" y="9.5" width="8.167" height="1" style="fill:#00bd02"/><rect x="11.333" y="12.083" width="12.5" height="1" style="fill:#00bd02"/><rect x="11.333" y="14.75" width="10.617" height="1" style="fill:#00bd02"/><rect [...]
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/index.css b/karavan-app/src/main/webui/src/index.css
index cfbf9ae8..1cdde350 100644
--- a/karavan-app/src/main/webui/src/index.css
+++ b/karavan-app/src/main/webui/src/index.css
@@ -105,6 +105,13 @@ html, body, #root {
padding-inline-end: var(--pf-t--global--spacer--sm);
}
+.karavan .pf-v6-c-log-viewer__header {
+ margin: 0;
+}
+.karavan .pf-v6-c-log-viewer__main {
+ border: none;
+}
+
.pf-v6-c-menu {
.pf-v6-c-menu__content {
row-gap: 0;
@@ -175,4 +182,80 @@ svg.carbon {
width: 1em;
height: 1em;
vertical-align: -0.125em;
-}
\ No newline at end of file
+}
+
+/*Animations*/
+
+@keyframes icon-flashing {
+ 0% {
+ color: var(--pf-t--color--green--20);
+ border-color: var(--pf-t--global--color--status--success--100);
+ }
+ 50% {
+ color: var(--pf-t--color--green--40);
+ border-color: var(--pf-t--global--color--status--success--200);
+ }
+ 100% {
+ color: var(--pf-t--color--green--60);
+ border-color: var(--pf-t--global--icon--color--status--success--default);
+ }
+}
+
+@keyframes scale-icon {
+ from {
+ transform: scale(1);
+ }
+ to {
+ transform: scale(1.1);
+ }
+}
+
+@keyframes rotate-icon-forward {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
+@keyframes rotate-icon-backward {
+ from {
+ transform: rotate(360deg);
+ }
+ to {
+ transform: rotate(0deg);
+ }
+}
+
+@keyframes logline {
+ 0% { opacity: 0; transform: translateX(-2px); }
+ 20% { opacity: 1; transform: translateX(0); }
+ 80% { opacity: 1; }
+ 100% { opacity: 0; }
+}
+
+@keyframes steam-movement {
+ 0% {
+ transform: translate(0, 0) scale(1, 1);
+ }
+ 25% {
+ transform: translate(0.5px, -1.5px) scale(1.1, 1.3);
+ }
+ 50% {
+ transform: translate(-0.3px, -2.2px) scale(0.95, 1.1);
+ }
+ 75% {
+ transform: translate(0.1px, -3px) scale(1.25, 1.15);
+ }
+ 100% {
+ transform: translate(0, 0) scale(1, 1);
+ }
+}
+
+@keyframes steam-opacity {
+ 0% { opacity: 0.7; }
+ 25% { opacity: 1; }
+ 50% { opacity: 0.85; }
+ 75% { opacity: 1; }
+ 100% { opacity: 0.7; }
+}
diff --git a/karavan-app/src/main/webui/src/index.tsx b/karavan-app/src/main/webui/src/index.tsx
index f511c039..920f0f25 100644
--- a/karavan-app/src/main/webui/src/index.tsx
+++ b/karavan-app/src/main/webui/src/index.tsx
@@ -20,18 +20,17 @@ import ReactDOM from 'react-dom/client';
import "@patternfly/patternfly/patternfly.css";
import "@patternfly/patternfly/patternfly-charts.css";
import './index.css';
-import {Main} from "./main/Main";
+import {App} from "@app/App";
import {BrowserRouter} from "react-router-dom";
-import {ThemeProvider} from "@/main/ThemeContext";
-import {AuthProvider} from "@/auth/AuthProvider";
-
+import {ThemeProvider} from "@app/theme/ThemeContext";
+import {AuthProvider} from "@api/auth/AuthProvider";
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<BrowserRouter>
<ThemeProvider>
<AuthProvider>
- <Main />
+ <App />
</AuthProvider>
</ThemeProvider>
</BrowserRouter>
diff --git a/karavan-app/src/main/webui/src/integration-runtime/InfoTabContainer.tsx b/karavan-app/src/main/webui/src/integration-runtime/InfoTabContainer.tsx
deleted file mode 100644
index df35e307..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/InfoTabContainer.tsx
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react';
-import {
- Badge,
- DescriptionList,
- DescriptionListDescription,
- DescriptionListGroup,
- DescriptionListTerm,
- Label,
-} from '@patternfly/react-core';
-import DownIcon from "@patternfly/react-icons/dist/esm/icons/error-circle-o-icon";
-import UpIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon";
-import {ContainerStatus} from "../api/ProjectModels";
-
-interface Props {
- containerStatus: ContainerStatus,
-}
-
-export function InfoTabContainer (props: Props) {
-
- function getPodInfoLabel(info: React.ReactNode) {
- return (
- <Label icon={getIcon()} color={getColor()}>
- {info}
- </Label>
- )
- }
-
- function getIcon() {
- return (getRunning() ? <UpIcon/> : <DownIcon/>)
- }
-
- function getColor() {
- return getRunning() ? "green" : "grey";
- }
-
- function getRunning(): boolean {
- return props.containerStatus.state === 'running';
- }
-
- const containerStatus = props.containerStatus;
- return (
- <DescriptionList isHorizontal className='description-align-center'>
- <DescriptionListGroup>
- <DescriptionListTerm>Container</DescriptionListTerm>
- <DescriptionListDescription>
- {getPodInfoLabel(
- <>
- {containerStatus.containerName}
- <Badge isRead>{containerStatus.type}</Badge>
- </>
- )}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Status</DescriptionListTerm>
- <DescriptionListDescription>
- {getPodInfoLabel(containerStatus.state)}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>CPU</DescriptionListTerm>
- <DescriptionListDescription>
- {getPodInfoLabel(containerStatus.cpuInfo)}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Memory</DescriptionListTerm>
- <DescriptionListDescription>
- {getPodInfoLabel(containerStatus.memoryInfo)}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Created</DescriptionListTerm>
- <DescriptionListDescription>
- {getPodInfoLabel(containerStatus.created)}
- </DescriptionListDescription>
- </DescriptionListGroup>
- </DescriptionList>
- );
-}
diff --git a/karavan-app/src/main/webui/src/integration-runtime/InfoTabContext.tsx b/karavan-app/src/main/webui/src/integration-runtime/InfoTabContext.tsx
deleted file mode 100644
index 6a963bae..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/InfoTabContext.tsx
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react';
-import {
- DescriptionList,
- DescriptionListDescription,
- DescriptionListGroup,
- DescriptionListTerm,
- Label, LabelGroup,
- Tooltip
-} from '@patternfly/react-core';
-import DownIcon from "@patternfly/react-icons/dist/esm/icons/error-circle-o-icon";
-import UpIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon";
-import {shallow} from "zustand/shallow";
-import {useProjectStore} from "../api/ProjectStore";
-import {ContainerStatus} from "../api/ProjectModels";
-
-interface Props {
- containerStatus: ContainerStatus
-}
-
-export function InfoTabContext (props: Props) {
- const [camelStatuses] = useProjectStore((state) => [state.camelStatuses], shallow);
-
- const camelStatus = camelStatuses.filter(s => s.containerName === props.containerStatus.containerName).at(0);
- const contextValue = camelStatus?.statuses?.filter(x => x.name === 'context').at(0);
- const context = contextValue ? JSON.parse(contextValue?.status || '') : {};
-
- function getContextInfo() {
- return (
- <LabelGroup numLabels={3}>
- <Tooltip content="Name" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.name}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getVersionInfo() {
- return (
- <LabelGroup numLabels={3}>
- <Tooltip content="Version" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.version}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getContextState() {
- return (
- <LabelGroup numLabels={3}>
- <Tooltip content="State" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.state}
- </Label>
- </Tooltip>
- <Tooltip content="Phase" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.phase}
- </Label>
- </Tooltip>
- <Tooltip content="Uptime" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.uptime}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getExchanges() {
- return (
- <LabelGroup numLabels={3}>
- <Tooltip content="Total" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.statistics?.exchangesTotal}
- </Label>
- </Tooltip>
- <Tooltip content="Failed" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.statistics?.exchangesFailed}
- </Label>
- </Tooltip>
- <Tooltip content="Inflight" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.statistics?.exchangesInflight}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getProcessingTime() {
- return (
- <LabelGroup numLabels={4}>
- <Tooltip content="Min" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.statistics?.minProcessingTime}
- </Label>
- </Tooltip>
- <Tooltip content="Mean" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.statistics?.meanProcessingTime}
- </Label>
- </Tooltip>
- <Tooltip content="Max" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.statistics?.maxProcessingTime}
- </Label>
- </Tooltip>
- <Tooltip content="Last" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {context?.context?.statistics?.lastProcessingTime}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getIcon() {
- return (getRunning() ? <UpIcon/> : <DownIcon/>)
- }
-
- function getColor() {
- return getRunning() ? "green" : "grey";
- }
-
- function getRunning(): boolean {
- return context ? isRunning(context) : false;
- }
-
-
- function isRunning(c: any): boolean {
- return c?.context?.state === 'Started';
- }
-
- return (
- <DescriptionList isHorizontal className='description-align-center'>
- <DescriptionListGroup>
- <DescriptionListTerm>Camel</DescriptionListTerm>
- <DescriptionListDescription>
- {getContextInfo()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Version</DescriptionListTerm>
- <DescriptionListDescription>
- {getVersionInfo()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>State</DescriptionListTerm>
- <DescriptionListDescription>
- {getContextState()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Exchanges:</DescriptionListTerm>
- <DescriptionListDescription>
- {getExchanges()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Processing Time</DescriptionListTerm>
- <DescriptionListDescription>
- {getProcessingTime()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- </DescriptionList>
- );
-}
diff --git a/karavan-app/src/main/webui/src/integration-runtime/InfoTabMemory.tsx b/karavan-app/src/main/webui/src/integration-runtime/InfoTabMemory.tsx
deleted file mode 100644
index 1836fc87..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/InfoTabMemory.tsx
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react';
-import {
- DescriptionList,
- DescriptionListDescription,
- DescriptionListGroup,
- DescriptionListTerm,
- Label, LabelGroup,
- Tooltip
-} from '@patternfly/react-core';
-import DownIcon from "@patternfly/react-icons/dist/esm/icons/error-circle-o-icon";
-import UpIcon from "@patternfly/react-icons/dist/esm/icons/check-circle-icon";
-import {shallow} from "zustand/shallow";
-import {useProjectStore} from "../api/ProjectStore";
-import { ContainerStatus } from '../api/ProjectModels';
-
-interface Props {
- containerStatus: ContainerStatus
-}
-
-export function InfoTabMemory (props: Props) {
-
- const [camelStatuses] = useProjectStore((state) => [state.camelStatuses], shallow);
-
- const camelStatus = camelStatuses.filter(s => s.containerName === props.containerStatus.containerName).at(0);
- const jvmValue = camelStatus?.statuses?.filter(x => x.name === 'jvm').at(0);
- const memoryValue = camelStatus?.statuses?.filter(x => x.name === 'memory').at(0);
- const jvm = jvmValue ? JSON.parse(jvmValue?.status || '') : {};
- const memory = memoryValue ? JSON.parse(memoryValue?.status || '') : {};
-
- function getJvmInfo() {
- return (
- <LabelGroup numLabels={2}>
- <Label icon={getIcon()} color={getColor()}>
- {jvm?.jvm?.vmVendor} {jvm?.jvm?.vmVersion}
- </Label>
- </LabelGroup>
- )
- }
-
- function getHeapInfo() {
- return (
- <LabelGroup numLabels={3}>
- <Tooltip content="Init" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {memory?.memory?.heapMemoryInit}
- </Label>
- </Tooltip>
- <Tooltip content="Max" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {memory?.memory?.heapMemoryMax}
- </Label>
- </Tooltip>
- <Tooltip content="Used" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {memory?.memory?.heapMemoryUsed}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getJvmUptime() {
- return (
- <LabelGroup numLabels={2}>
- <Tooltip content="Uptime" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {jvm?.jvm?.vmUptime}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getPid() {
- return (
- <LabelGroup numLabels={2}>
- <Tooltip content="PID" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {jvm?.jvm?.pid}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getNonHeapInfo() {
- return (
- <LabelGroup numLabels={3}>
- <Tooltip content="Init" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {memory?.memory?.nonHeapMemoryInit}
- </Label>
- </Tooltip>
- <Tooltip content="Max" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {memory?.memory?.nonHeapMemoryMax}
- </Label>
- </Tooltip>
- <Tooltip content="Used" position={"bottom"}>
- <Label icon={getIcon()} color={getColor()}>
- {memory?.memory?.nonHeapMemoryUsed}
- </Label>
- </Tooltip>
- </LabelGroup>
- )
- }
-
- function getIcon() {
- return (getRunning() ? <UpIcon/> : <DownIcon/>)
- }
-
- function getColor() {
- return getRunning() ? "green" : "grey";
- }
-
- function getRunning(): boolean {
- return isRunning(jvm);
- }
-
-
- function isRunning(c: any): boolean {
- return c?.jvm?.pid != undefined;
- }
-
- return (
- <DescriptionList isHorizontal className='description-align-center'>
- <DescriptionListGroup>
- <DescriptionListTerm>JVM</DescriptionListTerm>
- <DescriptionListDescription>
- {getJvmInfo()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>PID</DescriptionListTerm>
- <DescriptionListDescription>
- {getPid()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Uptime</DescriptionListTerm>
- <DescriptionListDescription>
- {getJvmUptime()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Heap</DescriptionListTerm>
- <DescriptionListDescription>
- {getHeapInfo()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- <DescriptionListGroup>
- <DescriptionListTerm>Non-Heap</DescriptionListTerm>
- <DescriptionListDescription>
- {getNonHeapInfo()}
- </DescriptionListDescription>
- </DescriptionListGroup>
- </DescriptionList>
- );
-}
diff --git a/karavan-app/src/main/webui/src/integration-runtime/InformationTab.tsx b/karavan-app/src/main/webui/src/integration-runtime/InformationTab.tsx
deleted file mode 100644
index be87b67d..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/InformationTab.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import React, {ReactElement} from 'react';
-import {Bullseye, Card, CardBody, Divider, EmptyState, EmptyStateVariant, Flex, FlexItem} from '@patternfly/react-core';
-import {InfoTabContainer} from "./InfoTabContainer";
-import {InfoTabContext} from "./InfoTabContext";
-import {InfoTabMemory} from "./InfoTabMemory";
-import {shallow} from "zustand/shallow";
-import SearchIcon from "@patternfly/react-icons/dist/esm/icons/search-icon";
-import {useStatusesStore} from "@/api/ProjectStore";
-
-interface Props {
- currentPodName: string
- header?: React.ReactNode
-}
-
-export function InformationTab(props: Props): ReactElement {
-
- const [containers] = useStatusesStore((state) => [state.containers], shallow);
- const camelContainers = containers.filter(cs => cs.containerName === props.currentPodName);
-
- return (
- <div style={{display: "flex", flexDirection: "column", position: "relative", height: "100%"}}>
- {props.header}
- {camelContainers.map((containerStatus, index) =>
- <Card key={containerStatus.containerId} isFullHeight style={{borderRadius: 0}}>
- <CardBody>
- <Flex direction={{default: "row"}}
- justifyContent={{default: "justifyContentSpaceBetween"}}>
- <FlexItem flex={{default: "flex_1"}}>
- <InfoTabContainer containerStatus={containerStatus}/>
- </FlexItem>
- <Divider orientation={{default: "vertical"}}/>
- <FlexItem flex={{default: "flex_1"}}>
- <InfoTabMemory containerStatus={containerStatus}/>
- </FlexItem>
- <Divider orientation={{default: "vertical"}}/>
- <FlexItem flex={{default: "flex_1"}}>
- <InfoTabContext containerStatus={containerStatus}/>
- </FlexItem>
- </Flex>
- </CardBody>
- </Card>
- )}
- {camelContainers.length === 0 &&
- <Card>
- <CardBody>
- <Bullseye>
- <EmptyState headingLevel="h2" icon={SearchIcon} titleText="No running containers" variant={EmptyStateVariant.sm}>
- </EmptyState>
- </Bullseye>
- </CardBody>
- </Card>
- }
- </div>
- )
-}
diff --git a/karavan-app/src/main/webui/src/integration-runtime/ProjectLog.css b/karavan-app/src/main/webui/src/integration-runtime/ProjectLog.css
deleted file mode 100644
index 67bd710a..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/ProjectLog.css
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-.karavan .project-log {
- position: absolute;
- bottom: 0;
- right: 0;
- width: 100%;
- z-index: 200;
- display: flex;
- flex-direction: column;
- align-items: stretch;
-}
-
-.karavan .project-log .buttons {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- gap: 8px;
- border-top: 1px solid var(--pf-t--global--border--color--default);
- background-color: var(--pf-t--global--background--color--secondary--default);
- padding: 6px;
- text-wrap: nowrap;
-}
-
-.karavan .project-log .buttons .toggle {
- flex-grow: 1;
-}
-.karavan .project-log .pf-v6-c-log-viewer__header {
- margin: 0;
-}
-
-.karavan .project-log .event-table {
- overflow: auto;
-}
-
-.karavan .project-log .route-table {
- overflow: auto;
-}
diff --git a/karavan-app/src/main/webui/src/integration-runtime/ProjectLogTab.tsx b/karavan-app/src/main/webui/src/integration-runtime/ProjectLogTab.tsx
deleted file mode 100644
index daaee99b..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/ProjectLogTab.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React, {useState} from 'react';
-import './ProjectLog.css';
-import {LogViewer} from '@patternfly/react-log-viewer';
-import {useLogStore} from "@/api/ProjectStore";
-import {shallow} from "zustand/shallow"
-import {useTheme} from '@/main/ThemeContext';
-
-interface Props {
- autoScroll: boolean
- isTextWrapped: boolean
- header?: React.ReactNode
-}
-
-export function ProjectLogTab(props: Props) {
- const {isDark} = useTheme();
- const [data, currentLine] = useLogStore((state) => [state.data, state.currentLine], shallow);
- const [logViewerRef] = useState(React.createRef());
-
- return (
- <LogViewer
- isTextWrapped={props.isTextWrapped}
- innerRef={logViewerRef}
- hasLineNumbers={false}
- loadingContent={"Loading..."}
- // header={}
- height={"100vh"}
- data={data.length > 0 ? data : "........."}
- scrollToRow={props.autoScroll ? currentLine : undefined}
- theme={isDark ? 'dark' : 'dark'}
- toolbar={props.header}
- />
- );
-}
diff --git a/karavan-app/src/main/webui/src/integration-runtime/RuntimeApi.tsx b/karavan-app/src/main/webui/src/integration-runtime/RuntimeApi.tsx
deleted file mode 100644
index b6e3f208..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/RuntimeApi.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import axios from "axios";
-import {IntegrationFile} from "karavan-core/lib/model/IntegrationDefinition";
-import {AuthApi} from "@/auth/AuthApi";
-import {ErrorEventBus} from "@/api/ErrorEventBus";
-import {MainConfiguration} from "@/integration-runtime/RuntimeModels";
-import {EventBus} from "@/integration-designer/utils/EventBus";
-
-axios.defaults.headers.common['Accept'] = 'application/json';
-axios.defaults.headers.common['Content-Type'] = 'application/json';
-const instance = AuthApi.getInstance();
-
-export class RuntimeApi {
-
- static async getMainConfiguration(containerId: string, after: (mainConfiguration: MainConfiguration[]) => void) {
- instance.get('/ui/runtime/main-configuration/' + containerId, {headers: {'Accept': 'application/json'}})
- .then(res => {
- if (res.status === 200) {
- after(res.data?.['main-configuration']?.configurations);
- } else {
- after([]);
- }
- }).catch(err => {
- ErrorEventBus.sendApiError(err);
- after([]);
- });
- }
-
- static async getRuntimeSources(projectId: string, after: (ifiles: IntegrationFile[]) => void) {
- instance.get('/ui/runtime/sources/' + projectId)
- .then(res => {
- if (res.status === 200) {
- const files: IntegrationFile[] = Object.getOwnPropertyNames(res?.data).map(key => new IntegrationFile(key, res.data[key]));
- after(files);
- } else {
- after([]);
- }
- }).catch(err => {
- ErrorEventBus.sendApiError(err);
- after([]);
- });
- }
-
- static async getRuntimeRouteAction(projectId: string, env: string, routeId: string, action: string, after: (res: any) => void) {
- instance.get(`/ui/runtime/route/${env}/${projectId}/${routeId}/${action}`)
- .then(res => {
- if (res.status === 200) {
- after(res.data);
- EventBus.sendAlert("Action Send", `Action ${action} for ${routeId} for ${projectId} send`);
- } else {
- after({});
- }
- }).catch(err => {
- ErrorEventBus.sendApiError(err);
- after([]);
- });
- }
-}
diff --git a/karavan-app/src/main/webui/src/integration-runtime/RuntimeModels.ts b/karavan-app/src/main/webui/src/integration-runtime/RuntimeModels.ts
deleted file mode 100644
index 80f302b3..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/RuntimeModels.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export class MainConfiguration {
- key: string = '';
- value: string = '';
- location: string = '';
- internal: boolean = false;
-}
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/integration-runtime/RuntimePanel.tsx b/karavan-app/src/main/webui/src/integration-runtime/RuntimePanel.tsx
deleted file mode 100644
index f7e8c674..00000000
--- a/karavan-app/src/main/webui/src/integration-runtime/RuntimePanel.tsx
+++ /dev/null
@@ -1,110 +0,0 @@
-import React, {useEffect, useState} from 'react';
-import {Button, capitalize, Checkbox, Content, Nav, NavItem, NavList, Tooltip, TooltipPosition} from '@patternfly/react-core';
-import './ProjectLog.css';
-import {CompressIcon, ExpandIcon, TimesIcon, TrashAltIcon} from '@patternfly/react-icons';
-import {useAppConfigStore, useLogStore, useStatusesStore} from "@/api/ProjectStore";
-import {shallow} from "zustand/shallow";
-import {ProjectEventBus} from "@/api/ProjectEventBus";
-import {ProjectLogTab} from "./ProjectLogTab";
-import {LogWatchApi} from "@/api/LogWatchApi";
-import {InformationTab} from "./InformationTab";
-import {LogViewerSearch} from '@patternfly/react-log-viewer';
-
-const INITIAL_LOG_HEIGHT = "50%";
-
-export function RuntimePanel() {
-
- const [config] = useAppConfigStore((state) => [state.config], shallow);
- const [containers] = useStatusesStore((state) => [state.containers], shallow);
- const [showLog, type, setShowLog, podName] = useLogStore(
- (state) => [state.showLog, state.type, state.setShowLog, state.podName], shallow)
-
- const [height, setHeight] = useState(INITIAL_LOG_HEIGHT);
- const [isTextWrapped, setIsTextWrapped] = useState(true);
- const [autoScroll, setAutoScroll] = useState(true);
- const [currentPodName, setCurrentPodName] = useState<string | undefined>(undefined);
- const [tab, setTab] = useState<'log' | 'events' | 'main-configuration' | 'info' | 'threads' | 'routes'>('log');
- const [controller, setController] = React.useState(new AbortController());
-
- useEffect(() => {
- setTab('log');
- controller.abort()
- const c = new AbortController();
- setController(c);
- if (showLog && type !== 'none' && podName !== undefined) {
- const f = LogWatchApi.fetchData(type, podName, c).then(_ => {
- console.log("Fetch Started for: " + podName);
- });
- }
- return () => {
- c.abort();
- };
- }, [showLog, type, podName]);
-
- useEffect(() => {
- if (currentPodName !== podName) {
- ProjectEventBus.sendLog("set", "");
- setCurrentPodName(podName);
- }
- }, [podName]);
-
- function getNavigation() {
- const isKubernetes = config.infrastructure === 'kubernetes';
- const containerType = containers.filter(c => c.containerName === podName).at(0)?.type;
- const showMain = containerType !== undefined && ['devmode', 'packaged'].includes(containerType);
- return (
- <Nav onSelect={(_, sel) => setTab(sel.itemId as 'log' | 'events' | 'main-configuration' | 'info')}
- variant="horizontal" aria-label="Horizontal nav local" style={{flexGrow: 2}}>
- <NavList>
- <NavItem preventDefault key={'info'} itemId={'info'} isActive={tab === 'info'} to={`#`}>Information</NavItem>
- <NavItem preventDefault key={'log'} itemId={'log'} isActive={tab === 'log'} to={`#`}>Log</NavItem>
- </NavList>
- </Nav>
- );
- }
-
- function getButtons() {
- const isKubernetes = config.infrastructure === 'kubernetes';
- const title = isKubernetes ? ('Pod (' + type + ") runtime ") : (capitalize(type) + " Runtime");
- return (
- <div className="buttons">
- <Content component='h6'>{podName !== undefined ? title : ''}</Content>
- {getNavigation()}
- {tab === 'log' &&
- <div style={{display: 'flex', justifyContent: 'flex-start', alignItems: 'center', gap: '12px'}}>
- <LogViewerSearch placeholder={'search'} minSearchChars={4}/>
- <Tooltip content={"Clean log"} position={TooltipPosition.bottom}>
- <Button variant="plain" onClick={() => ProjectEventBus.sendLog('set', '')} icon={<TrashAltIcon/>}/>
- </Tooltip>
- <Checkbox label="Wrap text" aria-label="wrap text checkbox" isChecked={isTextWrapped}
- id="wrap-text-checkbox"
- onChange={(_, checked) => setIsTextWrapped(checked)}/>
- <Checkbox label="Autoscroll" aria-label="autoscroll checkbox" isChecked={autoScroll}
- id="autoscroll-checkbox"
- onChange={(_, checked) => setAutoScroll(checked)}/>
-
- </div>
- }
- <Tooltip content={height === "100%" ? "Collapse" : "Expand"} position={TooltipPosition.bottom}>
- <Button variant="plain" onClick={() => {
- const h = height === "100%" ? INITIAL_LOG_HEIGHT : "100%";
- setHeight(h);
- ProjectEventBus.sendLog('add', ' ')
- }} icon={height === "100%" ? <CompressIcon/> : <ExpandIcon/>}/>
- </Tooltip>
- <Button variant="plain" onClick={() => {
- setShowLog(false, 'none');
- setHeight(INITIAL_LOG_HEIGHT);
- ProjectEventBus.sendLog('set', '')
- }} icon={<TimesIcon/>}/>
- </div>
- );
- }
-
- return (showLog ?
- <div className="project-log" style={{height: height}}>
- {tab === 'info' && currentPodName && <InformationTab currentPodName={currentPodName} header={getButtons()}/>}
- {tab === 'log' && <ProjectLogTab autoScroll={autoScroll} isTextWrapped={isTextWrapped} header={getButtons()}/>}
- </div>
- : <></>);
-}
diff --git a/karavan-app/src/main/webui/src/integration/ProjectPage.css b/karavan-app/src/main/webui/src/integration/ProjectPage.css
deleted file mode 100644
index 238abd36..00000000
--- a/karavan-app/src/main/webui/src/integration/ProjectPage.css
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-.karavan .project-page {
- display: flex;
- flex-direction: column;
- height: 100%;
-}
-
-.karavan .project-page .scrollable-out {
- display: flex;
- flex-direction: column;
- height: 100%;
-}
-
-.karavan .project-page .scrollable-in {
- overflow: auto;
- flex-shrink: unset;
- flex-grow: 1;
- margin-bottom: 100px;
-}
-
-.karavan .project-title {
- flex: 1;
- .pf-v6-l-flex.pf-m-column > * {
- margin-bottom: 0;
- }
- .pf-v6-c-clipboard-copy {
- width: fit-content;
- .pf-v6-c-button {
- padding: 0;
- }
- }
-}
-
-.karavan .project-page .tools-section {
- border-bottom: 1px solid #eee;
-}
-
-.karavan .project-page .project-tabs {
- background-color: white;
-}
-
-.karavan .project-page .description-align-center .pf-v6-c-description-list__group {
- min-height: 30px;
- align-items: center;
-}
-
-.karavan .project-page .pf-v6-c-tabs__link,
-.karavan .project-page .pf-m-link {
- font-size: 14px;
-}
-
-.karavan .project-page .project-button {
- width: 100px;
-}
-
-.karavan .project-page .badge-env-up {
- background-color: rgb(56, 129, 47);
- color: white;
-}
-
-.karavan .project-page .env-chart {
- font-size: 18px;
-}
-
-.karavan .project-page .replicas-ready {
- background-color: rgb(56, 129, 47);
- color: white;
-}
-
-.karavan .project-page .health-up {
- background-color: rgb(56, 129, 47);
- color: white;
-}
-
-.karavan .project-page .project-properties .delete-cell {
- padding: 0;
- margin: 0;
- min-width: 0;
-}
-.karavan .project-page .project-properties .delete-button {
- padding: 0 0 0 0;
- margin: 0 16px 0 0;
-}
-
-.karavan .project-page .pf-v6-c-label__icon {
- height: 16px;
-}
-
-.karavan .project-page .pf-v6-c-label__icon svg {
- height: 16px;
-}
-
-.karavan .project-page .pf-v6-c-label__icon, .spinner {
- margin-bottom: -2px;
-}
-
-.karavan .project-page .badge {
- font-size: 14px;
- font-weight: 400;
- padding: 4px 8px 4px 8px;
- min-width: 70px;
-}
-
-.karavan .project-files-toolbar {
- display: flex;
- justify-content: space-between;
- align-items: center;
- gap: 8px;
- padding: 8px 16px 8px 16px;
- position: relative;
-}
-
-.karavan .project-files-toolbar::before {
- position: absolute;
- inset: 0;
- pointer-events: none;
- content: "";
- border-bottom: var(--pf-t--global--border--color--default) solid var(--pf-t--global--border--width--box--default);
- border-radius: inherit;
-}
\ No newline at end of file
diff --git a/karavan-app/src/main/webui/src/integration/ResourceToolbar.tsx b/karavan-app/src/main/webui/src/integration/ResourceToolbar.tsx
deleted file mode 100644
index 5bebe181..00000000
--- a/karavan-app/src/main/webui/src/integration/ResourceToolbar.tsx
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React, {useState} from 'react';
-import {Button, Flex, FlexItem, Modal, ModalBody, ModalFooter, ModalHeader, Tooltip, TooltipPosition} from '@patternfly/react-core';
-import {useAppConfigStore, useProjectStore} from "@/api/ProjectStore";
-import {ProjectService} from "@/api/ProjectService";
-import {shallow} from "zustand/shallow";
-import RefreshIcon from "@patternfly/react-icons/dist/esm/icons/sync-alt-icon";
-import {ProjectType} from "@/api/ProjectModels";
-import {KaravanApi} from "@/api/KaravanApi";
-import ShareIcon from "@patternfly/react-icons/dist/esm/icons/share-alt-icon";
-
-
-export function ResourceToolbar() {
-
- const [project] = useProjectStore((state) => [state.project], shallow)
- const {config} = useAppConfigStore();
- const [showConfirmation, setShowConfirmation] = useState<boolean>(false);
-
- const isConfiguration = project.projectId === ProjectType.configuration.toString();
- const isKubernetes = config.infrastructure === 'kubernetes';
- const tooltip = isKubernetes ? "Save All Configmaps" : "Save all on shared volume";
- const confirmMessage = isKubernetes ? "Save all configurations as Configmaps" : "Save all configurations on shared volume";
-
- function shareConfigurations() {
- KaravanApi.shareConfigurations(res => {
- });
- setShowConfirmation(false);
- }
-
- function getConfirmation() {
- return (<Modal
- className="modal-confirm"
- variant={"small"}
- isOpen={showConfirmation}
- onClose={() => setShowConfirmation(false)}
- onEscapePress={e => setShowConfirmation(false)}>
- <ModalHeader title="Confirmation"/>
- <ModalBody>
- <div>{confirmMessage}</div>
- </ModalBody>
- <ModalFooter>
- <Button key="confirm" variant="primary" onClick={shareConfigurations}>Confirm</Button>
- <Button key="cancel" variant="link" onClick={_ => setShowConfirmation(false)}>Cancel</Button>
- </ModalFooter>
- </Modal>)
- }
-
- return (
- <Flex className="toolbar" direction={{default: "row"}} alignItems={{default: "alignItemsCenter"}}>
- {showConfirmation && getConfirmation()}
- <FlexItem>
- <Button icon={<RefreshIcon/>}
- variant={"link"}
- onClick={e => ProjectService.refreshProjectData(project.projectId)}
- />
- {isConfiguration &&
- <Tooltip content={tooltip} position={TooltipPosition.bottom}>
- <Button variant="primary" icon={<ShareIcon/>}
- onClick={_ => setShowConfirmation(true)}>
- Share all
- </Button>
- </Tooltip>
- }
- </FlexItem>
- </Flex>
- );
-}
diff --git a/karavan-app/src/main/webui/src/integration/files/FilesTab.tsx b/karavan-app/src/main/webui/src/integration/files/FilesTab.tsx
deleted file mode 100644
index b42162d0..00000000
--- a/karavan-app/src/main/webui/src/integration/files/FilesTab.tsx
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-import React, {useEffect, useState} from 'react';
-import {Badge, Bullseye, Button, EmptyState, EmptyStateVariant, Label, Tooltip} from '@patternfly/react-core';
-import {InnerScrollContainer, OuterScrollContainer, Table, Tbody, Td, Th, Thead, Tr} from '@patternfly/react-table';
-import {CheckIcon, DownloadIcon, OutlinedCopyIcon, SearchIcon, TimesIcon} from '@patternfly/react-icons';
-import {useAppConfigStore, useFilesStore, useFileStore, useProjectStore} from "@/api/ProjectStore";
-import {APPLICATION_PROPERTIES, DOCKER_COMPOSE, DOCKER_STACK, getProjectFileTypeByNameTitle, getProjectFileTypeTitle, ProjectFile, ProjectType} from "@/api/ProjectModels";
-import {FilesToolbar} from "./FilesToolbar";
-import FileSaver from "file-saver";
-import {CreateFileModal} from "./CreateFileModal";
-import {DeleteFileModal} from "./DeleteFileModal";
-import {UploadFileModal} from "./UploadFileModal";
-import {shallow} from "zustand/shallow";
-import {CreateIntegrationModal} from "./CreateIntegrationModal";
-import {DiffFileModal} from "./DiffFileModal";
-import {ProjectService} from "@/api/ProjectService";
-
-export function FilesTab() {
-
- const [config] = useAppConfigStore((s) => [s.config], shallow);
- const [files, diff, selectedFileNames, selectFile, unselectFile, setSelectedFileNames] = useFilesStore((s) => [s.files, s.diff, s.selectedFileNames, s.selectFile, s.unselectFile, s.setSelectedFileNames], shallow);
- const [project, setTabIndex] = useProjectStore((s) => [s.project, s.setTabIndex], shallow);
- const [setFile] = useFileStore((s) => [s.setFile], shallow);
- const [id, setId] = useState<string>('');
-
- const filenames = files.map(f => f.name);
- const deletedFilenames: string[] = Object.getOwnPropertyNames(diff)
- .map(name => diff[name] === 'DELETED' ? name : '')
- .filter(name => name !== '' && !filenames.includes(name));
- const deletedFiles: ProjectFile[] = deletedFilenames.map(d => new ProjectFile(d, project.projectId, '', 0))
- const allFiles = files.concat(deletedFiles);
-
- useEffect(() => {
- onRefresh();
- setSelectedFileNames([]);
- }, []);
-
- function onRefresh() {
- if (project.projectId) {
- ProjectService.refreshProjectFiles(project.projectId);
- }
- }
-
- function needCommit(filename: string): boolean {
- return diff && diff[filename] !== undefined;
- }
-
- function download(file: ProjectFile) {
- if (file) {
- const type = file.name.endsWith("yaml") ? "application/yaml;charset=utf-8" : undefined;
- const f = new File([file.code], file.name, {type: type});
- FileSaver.saveAs(f);
- }
- }
-
- function canDeleteFiles(filename: string): boolean {
- if (deletedFilenames.includes(filename)) {
- return false;
- } else if (project.projectId === ProjectType.templates.toString()) {
- return false;
- } else if (project.projectId === ProjectType.configuration.toString()) {
- return !config.configFilenames.includes(filename);
- } else if (config.infrastructure === 'kubernetes') {
- return filename !== APPLICATION_PROPERTIES;
- }
- return ![APPLICATION_PROPERTIES, DOCKER_COMPOSE, DOCKER_STACK].includes(filename);
- }
-
- function isKameletsProject(): boolean {
- return project.projectId === 'kamelets';
- }
-
- function forOtherEnvironment(filename: string): boolean {
- const currentEnv = config.environment;
- const envs = config.environments;
-
- if (filename.endsWith(".jkube.yaml") || filename.endsWith("." + DOCKER_COMPOSE) || filename.endsWith("." + DOCKER_STACK)) {
- const parts = filename.split('.');
- const prefix = parts[0] && envs.includes(parts[0]) ? parts[0] : undefined;
- if (prefix && envs.includes(prefix) && prefix !== currentEnv) {
- return true;
- }
- if (!prefix) {
- const prefixedFilename = `${currentEnv}.${filename}`;
- return allFiles.map(f => f.name).includes(prefixedFilename);
- }
- }
- return false;
- }
-
- function selectAllFiles(isSelecting: boolean) {
- if (isSelecting) {
- allFiles.forEach(file => selectFile(file.name))
- } else {
- allFiles.forEach(file => unselectFile(file.name))
- }
- }
-
- return (<div>
- <FilesToolbar/>
- <OuterScrollContainer>
- <InnerScrollContainer>
- <Table aria-label="Files" variant={"compact"} className={"table"} isStickyHeader>
- <Thead>
- <Tr>
- <Th
- select={{
- onSelect: (_event, isSelecting) => selectAllFiles(isSelecting), isSelected: selectedFileNames.length === allFiles.length
- }}
- aria-label="Row select"
- />
- <Th key='type' width={20}>Type</Th>
- <Th key='filename' width={40}>Filename</Th>
- <Th key='status' width={30}>Status</Th>
- <Th key='action'></Th>
- </Tr>
- </Thead>
- <Tbody>
- {allFiles.map((file, rowIndex) => {
- const type = getProjectFileTypeTitle(file)
- const diffType = diff[file.name];
- const isForOtherEnv = forOtherEnvironment(file.name);
- return (
- <Tr key={file.name}>
- <Td
- select={{
- rowIndex, onSelect: (_event, isSelecting) => {
- if (isSelecting) {
- selectFile(file.name);
- } else {
- unselectFile(file.name);
- }
- }, isSelected: selectedFileNames.includes(file.name),
- }}
- />
- <Td>
- <Badge isRead={isForOtherEnv}>{type}</Badge>
- </Td>
- <Td>
- <Button style={{padding: '6px'}} variant={isForOtherEnv ? 'plain' : 'link'}
- onClick={e => {
- setFile('select', file, undefined);
- setTabIndex(0);
- }}>
- {file.name}
- </Button>
- </Td>
- <Td>
- {needCommit(file.name) && <Tooltip content="Show diff" position={"right"}>
- <Label color="grey">
- <Button size="sm" variant="link" className='karavan-labeled-button'
- icon={<OutlinedCopyIcon/>}
- onClick={e => {
- setFile('diff', file, undefined);
- setId(Math.random().toString());
- }}>
- {diffType}
- </Button>
- </Label>
- </Tooltip>}
- {!needCommit(file.name) && <Label color="green" icon={<CheckIcon/>}/>}
- </Td>
- <Td modifier={"fitContent"}>
- <Button icon={<TimesIcon/>} className="dev-action-button" variant={"plain"}
- isDisabled={!canDeleteFiles(file.name)}
- onClick={e => setFile('delete', file)}/>
- <Tooltip content="Download source" position={"bottom-end"}>
- <Button className="dev-action-button" size="sm" variant="plain" icon={<DownloadIcon/>} onClick={e => download(file)}/>
- </Tooltip>
- </Td>
- </Tr>)
- })}
- {diff && Object.keys(diff).filter(f => diff[f] === 'DELETE').map(fileName => {
- const type = getProjectFileTypeByNameTitle(fileName)
- return <Tr key={fileName}>
- <Td><Badge>{type}</Badge></Td>
- <Td>{fileName}</Td>
- <Td><Label color="grey">{diff[fileName]}</Label></Td>
- <Td modifier={"fitContent"}></Td>
- </Tr>
- })}
- {files.length === 0 && <Tr>
- <Td colSpan={8}>
- <Bullseye>
- <EmptyState headingLevel="h2" icon={SearchIcon} titleText="No results found" variant={EmptyStateVariant.sm}>
- </EmptyState>
- </Bullseye>
- </Td>
- </Tr>}
- </Tbody>
- </Table>
- </InnerScrollContainer>
- </OuterScrollContainer>
- <UploadFileModal/>
- <DeleteFileModal/>
- <DiffFileModal id={id}/>
- {!isKameletsProject() && <CreateFileModal/>}
- {isKameletsProject() && <CreateIntegrationModal/>}
- </div>)
-}
diff --git a/karavan-app/src/main/webui/src/integration/package/ContainerPanel.tsx b/karavan-app/src/main/webui/src/integration/package/ContainerPanel.tsx
deleted file mode 100644
index 44499ac4..00000000
--- a/karavan-app/src/main/webui/src/integration/package/ContainerPanel.tsx
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React from 'react';
-import {Badge, Card, CardBody, Content,} from '@patternfly/react-core';
-import {useAppConfigStore} from "@/api/ProjectStore";
-import {ContainerEnvironmentPanel} from "./ContainerEnvironmentPanel";
-import {DeploymentPanel} from "./DeploymentPanel";
-import {ContainerButtons} from "./ContainerButtons";
-import {DeploymentButtons} from "./DeploymentButtons";
-
-export function ContainerPanel() {
-
- const {config} = useAppConfigStore();
- const env = config.environment;
-
- function getTitle(title: string, width: string = 'auto') {
- return (
- <Content style={{width: width}}>
- <Content component='h4'>{title}</Content>
- </Content>
- )
- }
-
- return (
- <Card key={env} isCompact>
- <CardBody>
- <div style={{display: 'flex', flexDirection: 'row', justifyContent: 'start', gap: '16px'}}>
- <div style={{display: 'flex', flexDirection: 'row', justifyContent: 'start', alignItems: 'center', gap: '16px', width: '200px'}}>
- {getTitle("Environment", '90px')}
- <Badge className="badge">{env}</Badge>
- </div>
- <div style={{flex: '2', display: 'flex', flexDirection: 'row', justifyContent: 'end', alignItems: 'center', gap: '16px'}}>
- {env === config.environment && config.infrastructure !== 'kubernetes' && <ContainerButtons env={env}/>}
- {env === config.environment && config.infrastructure === 'kubernetes' && <DeploymentButtons env={env}/>}
- </div>
- </div>
- {config.infrastructure === 'kubernetes' &&
- <div style={{display: 'flex', flexDirection: 'row', justifyContent: 'start', gap: '16px', paddingTop: '16px'}}>
- <div style={{display: 'flex', flexDirection: 'row', justifyContent: 'start', alignItems: 'center', gap: '16px'}}>
- {getTitle("Deployment", '90px')}
- </div>
- <div style={{flex: '3', display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: '16px'}}>
- <DeploymentPanel/>
- </div>
- </div>
- }
- <div style={{display: 'flex', flexDirection: 'row', justifyContent: 'start', gap: '16px', paddingTop: '16px'}}>
- <div style={{display: 'flex', flexDirection: 'row', justifyContent: 'start', alignItems: 'center', gap: '16px'}}>
- {getTitle("Containers", '90px')}
- </div>
- <div style={{flex: '3', display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', gap: '16px'}}>
- <ContainerEnvironmentPanel env={env}/>
- </div>
- </div>
- </CardBody>
- </Card>
- )
-}
diff --git a/karavan-app/src/main/webui/src/integrations/ProjectStatusLabel.tsx b/karavan-app/src/main/webui/src/integrations/ProjectStatusLabel.tsx
deleted file mode 100644
index 0d10beda..00000000
--- a/karavan-app/src/main/webui/src/integrations/ProjectStatusLabel.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http:www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import React, {ReactElement} from 'react';
-import UpIcon from "@patternfly/react-icons/dist/esm/icons/running-icon";
-import DownIcon from "@patternfly/react-icons/dist/esm/icons/error-circle-o-icon";
-import {ContainerStatus, ContainerType} from '@/api/ProjectModels';
-import DevIcon from "@patternfly/react-icons/dist/esm/icons/dev-icon";
-import {BuildIcon, LockIcon, PackageIcon, ServiceIcon, UnknownIcon} from '@patternfly/react-icons';
-import {Label} from "@patternfly/react-core";
-
-interface Props {
- container: ContainerStatus,
-}
-
-export function ProjectStatusLabel(props: Props) {
-
- const {container} = props;
- const isRunning = container && container.state === 'running';
- const buttonClassName = isRunning ? "karavan-container-button-up" : "karavan-container-button-down";
- const iconClassName = isRunning ? "karavan-container-button-icon-up" : "karavan-container-button-icon-down";
- const buttonVariant = isRunning ? "secondary" : "tertiary";
- const icon = isRunning ? <UpIcon className={iconClassName}/> : <DownIcon color={'var(--pf-v6-c-button--m-control--Color)'}/>;
- const typeIconColor = isRunning ? 'var(--pf-t--global--color--status--success--100)' : 'var(--pf-v6-c-button--m-control--Color)';
- const iconMap: Record<ContainerType, ReactElement> = {
- devmode: <DevIcon color={typeIconColor}/>,
- devservice: <ServiceIcon color={typeIconColor}/>,
- packaged: <PackageIcon color={typeIconColor}/>,
- internal: <LockIcon color={typeIconColor}/>,
- build: <BuildIcon color={typeIconColor}/>,
- unknown: <UnknownIcon color={typeIconColor}/>,
- };
- const typeMap: Record<ContainerType, string> = {
- devmode: 'container',
- devservice: 'devservice',
- packaged: 'container',
- internal: 'internal',
- build: 'build',
- unknown: 'unknown',
- };
- const type: ContainerType = container?.type || 'unknown';
- const typeIcon = iconMap[type];
-
- return (
- <Label color='green' icon={icon} >
- <div style={{display: 'flex', alignItems: 'center', gap: '0.4rem'}}>
- {typeIcon}
- </div>
- </Label>
- )
-}
diff --git a/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionApi.ts b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionApi.ts
new file mode 100644
index 00000000..db35234f
--- /dev/null
+++ b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionApi.ts
@@ -0,0 +1,3416 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Generated by karavan build tools - do NOT edit this file!
+ */
+import {CamelElement} from "../model/IntegrationDefinition";
+import {
+ ProcessorDefinition,
+ BeansDeserializer,
+ DataFormatsDefinitionDeserializer,
+ ErrorHandlerDeserializer,
+ OutputAwareFromDefinition,
+ AggregateDefinition,
+ BeanDefinition,
+ BeanFactoryDefinition,
+ CatchDefinition,
+ ChoiceDefinition,
+ CircuitBreakerDefinition,
+ ClaimCheckDefinition,
+ ContextScanDefinition,
+ ConvertBodyDefinition,
+ ConvertHeaderDefinition,
+ ConvertVariableDefinition,
+ DataFormatDefinition,
+ DelayDefinition,
+ DynamicRouterDefinition,
+ EnrichDefinition,
+ ErrorHandlerDefinition,
+ ExpressionSubElementDefinition,
+ FaultToleranceConfigurationDefinition,
+ FilterDefinition,
+ FinallyDefinition,
+ FromDefinition,
+ GlobalOptionDefinition,
+ GlobalOptionsDefinition,
+ IdempotentConsumerDefinition,
+ InputTypeDefinition,
+ InterceptDefinition,
+ InterceptFromDefinition,
+ InterceptSendToEndpointDefinition,
+ KameletDefinition,
+ LoadBalanceDefinition,
+ LogDefinition,
+ LoopDefinition,
+ MarshalDefinition,
+ MulticastDefinition,
+ OnCompletionDefinition,
+ OnExceptionDefinition,
+ OnFallbackDefinition,
+ OnWhenDefinition,
+ OptimisticLockRetryPolicyDefinition,
+ OtherwiseDefinition,
+ OutputDefinition,
+ OutputTypeDefinition,
+ PackageScanDefinition,
+ PausableDefinition,
+ PipelineDefinition,
+ PolicyDefinition,
+ PollDefinition,
+ PollEnrichDefinition,
+ ProcessDefinition,
+ PropertyDefinition,
+ PropertyExpressionDefinition,
+ RecipientListDefinition,
+ RedeliveryPolicyDefinition,
+ RemoveHeaderDefinition,
+ RemoveHeadersDefinition,
+ RemovePropertiesDefinition,
+ RemovePropertyDefinition,
+ RemoveVariableDefinition,
+ ResequenceDefinition,
+ Resilience4jConfigurationDefinition,
+ RestContextRefDefinition,
+ ResumableDefinition,
+ RollbackDefinition,
+ RouteBuilderDefinition,
+ RouteConfigurationContextRefDefinition,
+ RouteConfigurationDefinition,
+ RouteContextRefDefinition,
+ RouteDefinition,
+ RouteTemplateDefinition,
+ RouteTemplateParameterDefinition,
+ RoutingSlipDefinition,
+ SagaActionUriDefinition,
+ SagaDefinition,
+ SamplingDefinition,
+ ScriptDefinition,
+ SetBodyDefinition,
+ SetExchangePatternDefinition,
+ SetHeaderDefinition,
+ SetHeadersDefinition,
+ SetPropertyDefinition,
+ SetVariableDefinition,
+ SetVariablesDefinition,
+ SortDefinition,
+ SplitDefinition,
+ StepDefinition,
+ StopDefinition,
+ TemplatedRouteDefinition,
+ TemplatedRouteParameterDefinition,
+ ThreadPoolProfileDefinition,
+ ThreadsDefinition,
+ ThrottleDefinition,
+ ThrowExceptionDefinition,
+ ToDefinition,
+ ToDynamicDefinition,
+ TokenizerDefinition,
+ TokenizerImplementationDefinition,
+ TransactedDefinition,
+ TransformDefinition,
+ TryDefinition,
+ UnmarshalDefinition,
+ ValidateDefinition,
+ ValueDefinition,
+ WhenDefinition,
+ WireTapDefinition,
+ BeanConstructorDefinition,
+ BeanConstructorsDefinition,
+ BeanPropertiesDefinition,
+ BeanPropertyDefinition,
+ ComponentScanDefinition,
+ BatchResequencerConfig,
+ StreamResequencerConfig,
+ ASN1DataFormat,
+ AvroDataFormat,
+ BarcodeDataFormat,
+ Base64DataFormat,
+ BeanioDataFormat,
+ BindyDataFormat,
+ CBORDataFormat,
+ CryptoDataFormat,
+ CsvDataFormat,
+ CustomDataFormat,
+ DataFormatsDefinition,
+ DfdlDataFormat,
+ FhirJsonDataFormat,
+ FhirXmlDataFormat,
+ FlatpackDataFormat,
+ ForyDataFormat,
+ GrokDataFormat,
+ GzipDeflaterDataFormat,
+ HL7DataFormat,
+ IcalDataFormat,
+ Iso8583DataFormat,
+ JacksonXMLDataFormat,
+ JaxbDataFormat,
+ JsonApiDataFormat,
+ JsonDataFormat,
+ LZFDataFormat,
+ MimeMultipartDataFormat,
+ PGPDataFormat,
+ ParquetAvroDataFormat,
+ ProtobufDataFormat,
+ RssDataFormat,
+ SmooksDataFormat,
+ SoapDataFormat,
+ SwiftMtDataFormat,
+ SwiftMxDataFormat,
+ SyslogDataFormat,
+ TarFileDataFormat,
+ ThriftDataFormat,
+ TidyMarkupDataFormat,
+ UniVocityCsvDataFormat,
+ UniVocityFixedDataFormat,
+ UniVocityHeader,
+ UniVocityTsvDataFormat,
+ XMLSecurityDataFormat,
+ YAMLDataFormat,
+ YAMLTypeFilterDefinition,
+ ZipDeflaterDataFormat,
+ ZipFileDataFormat,
+ DeadLetterChannelDefinition,
+ DefaultErrorHandlerDefinition,
+ JtaTransactionErrorHandlerDefinition,
+ NoErrorHandlerDefinition,
+ RefErrorHandlerDefinition,
+ SpringTransactionErrorHandlerDefinition,
+ CSimpleExpression,
+ ConstantExpression,
+ DatasonnetExpression,
+ ExchangePropertyExpression,
+ ExpressionDefinition,
+ GroovyExpression,
+ HeaderExpression,
+ Hl7TerserExpression,
+ JavaExpression,
+ JavaScriptExpression,
+ JqExpression,
+ JsonPathExpression,
+ LanguageExpression,
+ MethodCallExpression,
+ MvelExpression,
+ PythonExpression,
+ RefExpression,
+ SimpleExpression,
+ SpELExpression,
+ TokenizerExpression,
+ VariableExpression,
+ WasmExpression,
+ XMLTokenizerExpression,
+ XPathExpression,
+ XQueryExpression,
+ CustomLoadBalancerDefinition,
+ FailoverLoadBalancerDefinition,
+ RandomLoadBalancerDefinition,
+ RoundRobinLoadBalancerDefinition,
+ StickyLoadBalancerDefinition,
+ TopicLoadBalancerDefinition,
+ WeightedLoadBalancerDefinition,
+ ApiKeyDefinition,
+ BasicAuthDefinition,
+ BearerTokenDefinition,
+ DeleteDefinition,
+ GetDefinition,
+ HeadDefinition,
+ MutualTLSDefinition,
+ OAuth2Definition,
+ OpenApiDefinition,
+ OpenIdConnectDefinition,
+ ParamDefinition,
+ PatchDefinition,
+ PostDefinition,
+ PutDefinition,
+ ResponseHeaderDefinition,
+ ResponseMessageDefinition,
+ RestBindingDefinition,
+ RestConfigurationDefinition,
+ RestDefinition,
+ RestPropertyDefinition,
+ RestSecuritiesDefinition,
+ RestsDefinition,
+ SecurityDefinition,
+ LangChain4jCharacterTokenizerDefinition,
+ LangChain4jLineTokenizerDefinition,
+ LangChain4jParagraphTokenizerDefinition,
+ LangChain4jSentenceTokenizerDefinition,
+ LangChain4jTokenizerDefinition,
+ LangChain4jWordTokenizerDefinition,
+ CustomTransformerDefinition,
+ DataFormatTransformerDefinition,
+ EndpointTransformerDefinition,
+ LoadTransformerDefinition,
+ TransformersDefinition,
+ CustomValidatorDefinition,
+ EndpointValidatorDefinition,
+ PredicateValidatorDefinition,
+ ValidatorsDefinition,
+} from '../model/CamelDefinition';
+import {CamelUtil} from './CamelUtil';
+
+export class CamelDefinitionApi {
+
+ static createProcessorDefinition = (element: any): ProcessorDefinition => {
+ const def = element ? new ProcessorDefinition({...element}) : new ProcessorDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.aggregate !== undefined) {
+ def.aggregate = CamelDefinitionApi.createAggregateDefinition(element.aggregate);
+ }
+ if (element?.bean !== undefined) {
+ def.bean = CamelDefinitionApi.createBeanDefinition(element.bean);
+ }
+ if (element?.doCatch !== undefined) {
+ def.doCatch = CamelDefinitionApi.createCatchDefinition(element.doCatch);
+ }
+ if (element?.choice !== undefined) {
+ def.choice = CamelDefinitionApi.createChoiceDefinition(element.choice);
+ }
+ if (element?.circuitBreaker !== undefined) {
+ def.circuitBreaker = CamelDefinitionApi.createCircuitBreakerDefinition(element.circuitBreaker);
+ }
+ if (element?.claimCheck !== undefined) {
+ def.claimCheck = CamelDefinitionApi.createClaimCheckDefinition(element.claimCheck);
+ }
+ if (element?.convertBodyTo !== undefined) {
+ def.convertBodyTo = CamelDefinitionApi.createConvertBodyDefinition(element.convertBodyTo);
+ }
+ 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);
+ }
+ if (element?.dynamicRouter !== undefined) {
+ def.dynamicRouter = CamelDefinitionApi.createDynamicRouterDefinition(element.dynamicRouter);
+ }
+ if (element?.enrich !== undefined) {
+ def.enrich = CamelDefinitionApi.createEnrichDefinition(element.enrich);
+ }
+ if (element?.filter !== undefined) {
+ def.filter = CamelDefinitionApi.createFilterDefinition(element.filter);
+ }
+ if (element?.doFinally !== undefined) {
+ def.doFinally = CamelDefinitionApi.createFinallyDefinition(element.doFinally);
+ }
+ if (element?.idempotentConsumer !== undefined) {
+ def.idempotentConsumer = CamelDefinitionApi.createIdempotentConsumerDefinition(element.idempotentConsumer);
+ }
+ if (element?.kamelet !== undefined) {
+ def.kamelet = CamelDefinitionApi.createKameletDefinition(element.kamelet);
+ }
+ if (element?.loadBalance !== undefined) {
+ def.loadBalance = CamelDefinitionApi.createLoadBalanceDefinition(element.loadBalance);
+ }
+ if (element?.log !== undefined) {
+ def.log = CamelDefinitionApi.createLogDefinition(element.log);
+ }
+ if (element?.loop !== undefined) {
+ def.loop = CamelDefinitionApi.createLoopDefinition(element.loop);
+ }
+ if (element?.marshal !== undefined) {
+ def.marshal = CamelDefinitionApi.createMarshalDefinition(element.marshal);
+ }
+ if (element?.multicast !== undefined) {
+ def.multicast = CamelDefinitionApi.createMulticastDefinition(element.multicast);
+ }
+ if (element?.pausable !== undefined) {
+ def.pausable = CamelDefinitionApi.createPausableDefinition(element.pausable);
+ }
+ if (element?.pipeline !== undefined) {
+ def.pipeline = CamelDefinitionApi.createPipelineDefinition(element.pipeline);
+ }
+ if (element?.policy !== undefined) {
+ def.policy = CamelDefinitionApi.createPolicyDefinition(element.policy);
+ }
+ if (element?.poll !== undefined) {
+ def.poll = CamelDefinitionApi.createPollDefinition(element.poll);
+ }
+ if (element?.pollEnrich !== undefined) {
+ def.pollEnrich = CamelDefinitionApi.createPollEnrichDefinition(element.pollEnrich);
+ }
+ if (element?.process !== undefined) {
+ def.process = CamelDefinitionApi.createProcessDefinition(element.process);
+ }
+ if (element?.recipientList !== undefined) {
+ def.recipientList = CamelDefinitionApi.createRecipientListDefinition(element.recipientList);
+ }
+ if (element?.removeHeader !== undefined) {
+ def.removeHeader = CamelDefinitionApi.createRemoveHeaderDefinition(element.removeHeader);
+ }
+ if (element?.removeHeaders !== undefined) {
+ def.removeHeaders = CamelDefinitionApi.createRemoveHeadersDefinition(element.removeHeaders);
+ }
+ if (element?.removeProperties !== undefined) {
+ def.removeProperties = CamelDefinitionApi.createRemovePropertiesDefinition(element.removeProperties);
+ }
+ 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);
+ }
+ if (element?.resumable !== undefined) {
+ def.resumable = CamelDefinitionApi.createResumableDefinition(element.resumable);
+ }
+ if (element?.rollback !== undefined) {
+ def.rollback = CamelDefinitionApi.createRollbackDefinition(element.rollback);
+ }
+ if (element?.routingSlip !== undefined) {
+ def.routingSlip = CamelDefinitionApi.createRoutingSlipDefinition(element.routingSlip);
+ }
+ if (element?.saga !== undefined) {
+ def.saga = CamelDefinitionApi.createSagaDefinition(element.saga);
+ }
+ if (element?.sample !== undefined) {
+ def.sample = CamelDefinitionApi.createSamplingDefinition(element.sample);
+ }
+ if (element?.script !== undefined) {
+ def.script = CamelDefinitionApi.createScriptDefinition(element.script);
+ }
+ if (element?.setBody !== undefined) {
+ def.setBody = CamelDefinitionApi.createSetBodyDefinition(element.setBody);
+ }
+ if (element?.setExchangePattern !== undefined) {
+ def.setExchangePattern = CamelDefinitionApi.createSetExchangePatternDefinition(element.setExchangePattern);
+ }
+ if (element?.setHeader !== undefined) {
+ def.setHeader = CamelDefinitionApi.createSetHeaderDefinition(element.setHeader);
+ }
+ if (element?.setHeaders !== undefined) {
+ def.setHeaders = CamelDefinitionApi.createSetHeadersDefinition(element.setHeaders);
+ }
+ if (element?.setProperty !== undefined) {
+ def.setProperty = CamelDefinitionApi.createSetPropertyDefinition(element.setProperty);
+ }
+ if (element?.setVariable !== undefined) {
+ def.setVariable = CamelDefinitionApi.createSetVariableDefinition(element.setVariable);
+ }
+ if (element?.setVariables !== undefined) {
+ def.setVariables = CamelDefinitionApi.createSetVariablesDefinition(element.setVariables);
+ }
+ if (element?.sort !== undefined) {
+ def.sort = CamelDefinitionApi.createSortDefinition(element.sort);
+ }
+ if (element?.split !== undefined) {
+ def.split = CamelDefinitionApi.createSplitDefinition(element.split);
+ }
+ if (element?.step !== undefined) {
+ def.step = CamelDefinitionApi.createStepDefinition(element.step);
+ }
+ if (element?.stop !== undefined) {
+ def.stop = CamelDefinitionApi.createStopDefinition(element.stop);
+ }
+ if (element?.threads !== undefined) {
+ def.threads = CamelDefinitionApi.createThreadsDefinition(element.threads);
+ }
+ if (element?.throttle !== undefined) {
+ def.throttle = CamelDefinitionApi.createThrottleDefinition(element.throttle);
+ }
+ if (element?.throwException !== undefined) {
+ def.throwException = CamelDefinitionApi.createThrowExceptionDefinition(element.throwException);
+ }
+ if (element?.tokenizer !== undefined) {
+ def.tokenizer = CamelDefinitionApi.createTokenizerDefinition(element.tokenizer);
+ }
+ if (element?.transacted !== undefined) {
+ def.transacted = CamelDefinitionApi.createTransactedDefinition(element.transacted);
+ }
+ if (element?.transform !== undefined) {
+ def.transform = CamelDefinitionApi.createTransformDefinition(element.transform);
+ }
+ if (element?.doTry !== undefined) {
+ def.doTry = CamelDefinitionApi.createTryDefinition(element.doTry);
+ }
+ if (element?.unmarshal !== undefined) {
+ def.unmarshal = CamelDefinitionApi.createUnmarshalDefinition(element.unmarshal);
+ }
+ if (element?.validate !== undefined) {
+ def.validate = CamelDefinitionApi.createValidateDefinition(element.validate);
+ }
+ if (element?.wireTap !== undefined) {
+ def.wireTap = CamelDefinitionApi.createWireTapDefinition(element.wireTap);
+ }
+ return def;
+ }
+
+ static createBeansDeserializer = (element: any): BeansDeserializer => {
+ const def = element ? new BeansDeserializer({...element}) : new BeansDeserializer();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createDataFormatsDefinitionDeserializer = (element: any): DataFormatsDefinitionDeserializer => {
+ const def = element ? new DataFormatsDefinitionDeserializer({...element}) : new DataFormatsDefinitionDeserializer();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createErrorHandlerDeserializer = (element: any): ErrorHandlerDeserializer => {
+ const def = element ? new ErrorHandlerDeserializer({...element}) : new ErrorHandlerDeserializer();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.deadLetterChannel !== undefined) {
+ def.deadLetterChannel = CamelDefinitionApi.createDeadLetterChannelDefinition(element.deadLetterChannel);
+ }
+ if (element?.defaultErrorHandler !== undefined) {
+ def.defaultErrorHandler = CamelDefinitionApi.createDefaultErrorHandlerDefinition(element.defaultErrorHandler);
+ }
+ if (element?.jtaTransactionErrorHandler !== undefined) {
+ def.jtaTransactionErrorHandler = CamelDefinitionApi.createJtaTransactionErrorHandlerDefinition(element.jtaTransactionErrorHandler);
+ }
+ if (element?.noErrorHandler !== undefined) {
+ def.noErrorHandler = CamelDefinitionApi.createNoErrorHandlerDefinition(element.noErrorHandler);
+ }
+ if (element?.refErrorHandler !== undefined) {
+ def.refErrorHandler = CamelDefinitionApi.createRefErrorHandlerDefinition(element.refErrorHandler);
+ }
+ if (element?.springTransactionErrorHandler !== undefined) {
+ def.springTransactionErrorHandler = CamelDefinitionApi.createSpringTransactionErrorHandlerDefinition(element.springTransactionErrorHandler);
+ }
+ return def;
+ }
+
+ static createOutputAwareFromDefinition = (element: any): OutputAwareFromDefinition => {
+ const def = element ? new OutputAwareFromDefinition({...element}) : new OutputAwareFromDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createAggregateDefinition = (element: any): AggregateDefinition => {
+ const def = element ? new AggregateDefinition({...element}) : new AggregateDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.correlationExpression !== undefined) {
+ def.correlationExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.correlationExpression);
+ }
+ if (element?.completionPredicate !== undefined) {
+ def.completionPredicate = CamelDefinitionApi.createExpressionSubElementDefinition(element.completionPredicate);
+ }
+ if (element?.completionTimeoutExpression !== undefined) {
+ def.completionTimeoutExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.completionTimeoutExpression);
+ }
+ if (element?.completionSizeExpression !== undefined) {
+ def.completionSizeExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.completionSizeExpression);
+ }
+ if (element?.optimisticLockRetryPolicy !== undefined) {
+ def.optimisticLockRetryPolicy = CamelDefinitionApi.createOptimisticLockRetryPolicyDefinition(element.optimisticLockRetryPolicy);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createBeanDefinition = (element: any): BeanDefinition => {
+ const def = element ? new BeanDefinition({...element}) : new BeanDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBeanFactoryDefinition = (element: any): BeanFactoryDefinition => {
+ const def = element ? new BeanFactoryDefinition({...element}) : new BeanFactoryDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createCatchDefinition = (element: any): CatchDefinition => {
+ const def = element ? new CatchDefinition({...element}) : new CatchDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.onWhen !== undefined) {
+ def.onWhen = CamelDefinitionApi.createOnWhenDefinition(element.onWhen);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createChoiceDefinition = (element: any): ChoiceDefinition => {
+ const def = element ? new ChoiceDefinition({...element}) : new ChoiceDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.when = element && element?.when ? element?.when.map((x:any) => CamelDefinitionApi.createWhenDefinition(x)) :[];
+ if (element?.otherwise !== undefined) {
+ def.otherwise = CamelDefinitionApi.createOtherwiseDefinition(element.otherwise);
+ }
+ return def;
+ }
+
+ static createCircuitBreakerDefinition = (element: any): CircuitBreakerDefinition => {
+ const def = element ? new CircuitBreakerDefinition({...element}) : new CircuitBreakerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.resilience4jConfiguration !== undefined) {
+ def.resilience4jConfiguration = CamelDefinitionApi.createResilience4jConfigurationDefinition(element.resilience4jConfiguration);
+ }
+ if (element?.faultToleranceConfiguration !== undefined) {
+ def.faultToleranceConfiguration = CamelDefinitionApi.createFaultToleranceConfigurationDefinition(element.faultToleranceConfiguration);
+ }
+ if (element?.onFallback !== undefined) {
+ def.onFallback = CamelDefinitionApi.createOnFallbackDefinition(element.onFallback);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createClaimCheckDefinition = (element: any): ClaimCheckDefinition => {
+ const def = element ? new ClaimCheckDefinition({...element}) : new ClaimCheckDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createContextScanDefinition = (element: any): ContextScanDefinition => {
+ const def = element ? new ContextScanDefinition({...element}) : new ContextScanDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createConvertBodyDefinition = (element: any): ConvertBodyDefinition => {
+ if (element && typeof element === 'string') {
+ element = {type: element};
+ }
+ const def = element ? new ConvertBodyDefinition({...element}) : new ConvertBodyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createConvertHeaderDefinition = (element: any): ConvertHeaderDefinition => {
+ const def = element ? new ConvertHeaderDefinition({...element}) : new ConvertHeaderDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ 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;
+ return def;
+ }
+
+ static createDelayDefinition = (element: any): DelayDefinition => {
+ const def = element ? new DelayDefinition({...element}) : new DelayDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createDynamicRouterDefinition = (element: any): DynamicRouterDefinition => {
+ const def = element ? new DynamicRouterDefinition({...element}) : new DynamicRouterDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createEnrichDefinition = (element: any): EnrichDefinition => {
+ const def = element ? new EnrichDefinition({...element}) : new EnrichDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createErrorHandlerDefinition = (element: any): ErrorHandlerDefinition => {
+ const def = element ? new ErrorHandlerDefinition({...element}) : new ErrorHandlerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.deadLetterChannel !== undefined) {
+ def.deadLetterChannel = CamelDefinitionApi.createDeadLetterChannelDefinition(element.deadLetterChannel);
+ }
+ if (element?.defaultErrorHandler !== undefined) {
+ def.defaultErrorHandler = CamelDefinitionApi.createDefaultErrorHandlerDefinition(element.defaultErrorHandler);
+ }
+ if (element?.jtaTransactionErrorHandler !== undefined) {
+ def.jtaTransactionErrorHandler = CamelDefinitionApi.createJtaTransactionErrorHandlerDefinition(element.jtaTransactionErrorHandler);
+ }
+ if (element?.noErrorHandler !== undefined) {
+ def.noErrorHandler = CamelDefinitionApi.createNoErrorHandlerDefinition(element.noErrorHandler);
+ }
+ if (element?.refErrorHandler !== undefined) {
+ def.refErrorHandler = CamelDefinitionApi.createRefErrorHandlerDefinition(element.refErrorHandler);
+ }
+ if (element?.springTransactionErrorHandler !== undefined) {
+ def.springTransactionErrorHandler = CamelDefinitionApi.createSpringTransactionErrorHandlerDefinition(element.springTransactionErrorHandler);
+ }
+ return def;
+ }
+
+ static createExpressionSubElementDefinition = (element: any): ExpressionSubElementDefinition => {
+ const def = element ? new ExpressionSubElementDefinition({...element}) : new ExpressionSubElementDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.constant !== undefined) {
+ def.constant = CamelDefinitionApi.createConstantExpression(element.constant);
+ }
+ if (element?.csimple !== undefined) {
+ def.csimple = CamelDefinitionApi.createCSimpleExpression(element.csimple);
+ }
+ if (element?.datasonnet !== undefined) {
+ def.datasonnet = CamelDefinitionApi.createDatasonnetExpression(element.datasonnet);
+ }
+ if (element?.exchangeProperty !== undefined) {
+ def.exchangeProperty = CamelDefinitionApi.createExchangePropertyExpression(element.exchangeProperty);
+ }
+ if (element?.groovy !== undefined) {
+ def.groovy = CamelDefinitionApi.createGroovyExpression(element.groovy);
+ }
+ if (element?.header !== undefined) {
+ def.header = CamelDefinitionApi.createHeaderExpression(element.header);
+ }
+ if (element?.hl7terser !== undefined) {
+ def.hl7terser = CamelDefinitionApi.createHl7TerserExpression(element.hl7terser);
+ }
+ if (element?.java !== undefined) {
+ def.java = CamelDefinitionApi.createJavaExpression(element.java);
+ }
+ if (element?.jq !== undefined) {
+ def.jq = CamelDefinitionApi.createJqExpression(element.jq);
+ }
+ if (element?.js !== undefined) {
+ def.js = CamelDefinitionApi.createJavaScriptExpression(element.js);
+ }
+ if (element?.jsonpath !== undefined) {
+ def.jsonpath = CamelDefinitionApi.createJsonPathExpression(element.jsonpath);
+ }
+ if (element?.language !== undefined) {
+ def.language = CamelDefinitionApi.createLanguageExpression(element.language);
+ }
+ if (element?.method !== undefined) {
+ def.method = CamelDefinitionApi.createMethodCallExpression(element.method);
+ }
+ if (element?.mvel !== undefined) {
+ def.mvel = CamelDefinitionApi.createMvelExpression(element.mvel);
+ }
+ if (element?.python !== undefined) {
+ def.python = CamelDefinitionApi.createPythonExpression(element.python);
+ }
+ if (element?.ref !== undefined) {
+ def.ref = CamelDefinitionApi.createRefExpression(element.ref);
+ }
+ if (element?.simple !== undefined) {
+ def.simple = CamelDefinitionApi.createSimpleExpression(element.simple);
+ }
+ if (element?.spel !== undefined) {
+ def.spel = CamelDefinitionApi.createSpELExpression(element.spel);
+ }
+ 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);
+ }
+ if (element?.xquery !== undefined) {
+ def.xquery = CamelDefinitionApi.createXQueryExpression(element.xquery);
+ }
+ if (element?.xtokenize !== undefined) {
+ def.xtokenize = CamelDefinitionApi.createXMLTokenizerExpression(element.xtokenize);
+ }
+ return def;
+ }
+
+ static createFaultToleranceConfigurationDefinition = (element: any): FaultToleranceConfigurationDefinition => {
+ const def = element ? new FaultToleranceConfigurationDefinition({...element}) : new FaultToleranceConfigurationDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createFilterDefinition = (element: any): FilterDefinition => {
+ const def = element ? new FilterDefinition({...element}) : new FilterDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createFinallyDefinition = (element: any): FinallyDefinition => {
+ const def = element ? new FinallyDefinition({...element}) : new FinallyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createFromDefinition = (element: any): FromDefinition => {
+ if (element && typeof element === 'string') {
+ element = { uri: element};
+ }
+ const def = element ? new FromDefinition({...element}) : new FromDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createGlobalOptionDefinition = (element: any): GlobalOptionDefinition => {
+ const def = element ? new GlobalOptionDefinition({...element}) : new GlobalOptionDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createGlobalOptionsDefinition = (element: any): GlobalOptionsDefinition => {
+ const def = element ? new GlobalOptionsDefinition({...element}) : new GlobalOptionsDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.globalOption = element && element?.globalOption ? element?.globalOption.map((x:any) => CamelDefinitionApi.createGlobalOptionDefinition(x)) :[];
+ return def;
+ }
+
+ static createIdempotentConsumerDefinition = (element: any): IdempotentConsumerDefinition => {
+ const def = element ? new IdempotentConsumerDefinition({...element}) : new IdempotentConsumerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createInputTypeDefinition = (element: any): InputTypeDefinition => {
+ const def = element ? new InputTypeDefinition({...element}) : new InputTypeDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createInterceptDefinition = (element: any): InterceptDefinition => {
+ const def = element ? new InterceptDefinition({...element}) : new InterceptDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.onWhen !== undefined) {
+ def.onWhen = CamelDefinitionApi.createOnWhenDefinition(element.onWhen);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createInterceptFromDefinition = (element: any): InterceptFromDefinition => {
+ const def = element ? new InterceptFromDefinition({...element}) : new InterceptFromDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.onWhen !== undefined) {
+ def.onWhen = CamelDefinitionApi.createOnWhenDefinition(element.onWhen);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createInterceptSendToEndpointDefinition = (element: any): InterceptSendToEndpointDefinition => {
+ if (element && typeof element === 'string') {
+ element = {uri: element};
+ }
+ const def = element ? new InterceptSendToEndpointDefinition({...element}) : new InterceptSendToEndpointDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.onWhen !== undefined) {
+ def.onWhen = CamelDefinitionApi.createOnWhenDefinition(element.onWhen);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createKameletDefinition = (element: any): KameletDefinition => {
+ if (element && typeof element === 'string') {
+ element = {name: element};
+ }
+ const def = element ? new KameletDefinition({...element}) : new KameletDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLoadBalanceDefinition = (element: any): LoadBalanceDefinition => {
+ const def = element ? new LoadBalanceDefinition({...element}) : new LoadBalanceDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.customLoadBalancer !== undefined) {
+ def.customLoadBalancer = CamelDefinitionApi.createCustomLoadBalancerDefinition(element.customLoadBalancer);
+ }
+ if (element?.failoverLoadBalancer !== undefined) {
+ def.failoverLoadBalancer = CamelDefinitionApi.createFailoverLoadBalancerDefinition(element.failoverLoadBalancer);
+ }
+ if (element?.randomLoadBalancer !== undefined) {
+ def.randomLoadBalancer = CamelDefinitionApi.createRandomLoadBalancerDefinition(element.randomLoadBalancer);
+ }
+ if (element?.roundRobinLoadBalancer !== undefined) {
+ def.roundRobinLoadBalancer = CamelDefinitionApi.createRoundRobinLoadBalancerDefinition(element.roundRobinLoadBalancer);
+ }
+ if (element?.stickyLoadBalancer !== undefined) {
+ def.stickyLoadBalancer = CamelDefinitionApi.createStickyLoadBalancerDefinition(element.stickyLoadBalancer);
+ }
+ if (element?.topicLoadBalancer !== undefined) {
+ def.topicLoadBalancer = CamelDefinitionApi.createTopicLoadBalancerDefinition(element.topicLoadBalancer);
+ }
+ if (element?.weightedLoadBalancer !== undefined) {
+ def.weightedLoadBalancer = CamelDefinitionApi.createWeightedLoadBalancerDefinition(element.weightedLoadBalancer);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createLogDefinition = (element: any): LogDefinition => {
+ if (element && typeof element === 'string') {
+ element = {message: element};
+ }
+ const def = element ? new LogDefinition({...element}) : new LogDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLoopDefinition = (element: any): LoopDefinition => {
+ const def = element ? new LoopDefinition({...element}) : new LoopDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createMarshalDefinition = (element: any): MarshalDefinition => {
+ const def = element ? new MarshalDefinition({...element}) : new MarshalDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.asn1 !== undefined) {
+ def.asn1 = CamelDefinitionApi.createASN1DataFormat(element.asn1);
+ }
+ if (element?.avro !== undefined) {
+ def.avro = CamelDefinitionApi.createAvroDataFormat(element.avro);
+ }
+ if (element?.barcode !== undefined) {
+ def.barcode = CamelDefinitionApi.createBarcodeDataFormat(element.barcode);
+ }
+ 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);
+ }
+ if (element?.cbor !== undefined) {
+ def.cbor = CamelDefinitionApi.createCBORDataFormat(element.cbor);
+ }
+ if (element?.crypto !== undefined) {
+ def.crypto = CamelDefinitionApi.createCryptoDataFormat(element.crypto);
+ }
+ if (element?.csv !== undefined) {
+ def.csv = CamelDefinitionApi.createCsvDataFormat(element.csv);
+ }
+ if (element?.custom !== undefined) {
+ def.custom = CamelDefinitionApi.createCustomDataFormat(element.custom);
+ }
+ if (element?.dfdl !== undefined) {
+ def.dfdl = CamelDefinitionApi.createDfdlDataFormat(element.dfdl);
+ }
+ if (element?.fhirJson !== undefined) {
+ def.fhirJson = CamelDefinitionApi.createFhirJsonDataFormat(element.fhirJson);
+ }
+ if (element?.fhirXml !== undefined) {
+ def.fhirXml = CamelDefinitionApi.createFhirXmlDataFormat(element.fhirXml);
+ }
+ if (element?.flatpack !== undefined) {
+ def.flatpack = CamelDefinitionApi.createFlatpackDataFormat(element.flatpack);
+ }
+ if (element?.fory !== undefined) {
+ def.fory = CamelDefinitionApi.createForyDataFormat(element.fory);
+ }
+ if (element?.grok !== undefined) {
+ def.grok = CamelDefinitionApi.createGrokDataFormat(element.grok);
+ }
+ if (element?.gzipDeflater !== undefined) {
+ def.gzipDeflater = CamelDefinitionApi.createGzipDeflaterDataFormat(element.gzipDeflater);
+ }
+ if (element?.hl7 !== undefined) {
+ def.hl7 = CamelDefinitionApi.createHL7DataFormat(element.hl7);
+ }
+ if (element?.ical !== undefined) {
+ def.ical = CamelDefinitionApi.createIcalDataFormat(element.ical);
+ }
+ if (element?.iso8583 !== undefined) {
+ def.iso8583 = CamelDefinitionApi.createIso8583DataFormat(element.iso8583);
+ }
+ if (element?.jacksonXml !== undefined) {
+ def.jacksonXml = CamelDefinitionApi.createJacksonXMLDataFormat(element.jacksonXml);
+ }
+ if (element?.jaxb !== undefined) {
+ def.jaxb = CamelDefinitionApi.createJaxbDataFormat(element.jaxb);
+ }
+ if (element?.json !== undefined) {
+ def.json = CamelDefinitionApi.createJsonDataFormat(element.json);
+ }
+ if (element?.jsonApi !== undefined) {
+ def.jsonApi = CamelDefinitionApi.createJsonApiDataFormat(element.jsonApi);
+ }
+ if (element?.lzf !== undefined) {
+ def.lzf = CamelDefinitionApi.createLZFDataFormat(element.lzf);
+ }
+ if (element?.mimeMultipart !== undefined) {
+ def.mimeMultipart = CamelDefinitionApi.createMimeMultipartDataFormat(element.mimeMultipart);
+ }
+ if (element?.parquetAvro !== undefined) {
+ def.parquetAvro = CamelDefinitionApi.createParquetAvroDataFormat(element.parquetAvro);
+ }
+ if (element?.pgp !== undefined) {
+ def.pgp = CamelDefinitionApi.createPGPDataFormat(element.pgp);
+ }
+ if (element?.protobuf !== undefined) {
+ def.protobuf = CamelDefinitionApi.createProtobufDataFormat(element.protobuf);
+ }
+ if (element?.rss !== undefined) {
+ def.rss = CamelDefinitionApi.createRssDataFormat(element.rss);
+ }
+ if (element?.smooks !== undefined) {
+ def.smooks = CamelDefinitionApi.createSmooksDataFormat(element.smooks);
+ }
+ if (element?.soap !== undefined) {
+ def.soap = CamelDefinitionApi.createSoapDataFormat(element.soap);
+ }
+ if (element?.swiftMt !== undefined) {
+ def.swiftMt = CamelDefinitionApi.createSwiftMtDataFormat(element.swiftMt);
+ }
+ if (element?.swiftMx !== undefined) {
+ def.swiftMx = CamelDefinitionApi.createSwiftMxDataFormat(element.swiftMx);
+ }
+ if (element?.syslog !== undefined) {
+ def.syslog = CamelDefinitionApi.createSyslogDataFormat(element.syslog);
+ }
+ if (element?.tarFile !== undefined) {
+ def.tarFile = CamelDefinitionApi.createTarFileDataFormat(element.tarFile);
+ }
+ if (element?.thrift !== undefined) {
+ def.thrift = CamelDefinitionApi.createThriftDataFormat(element.thrift);
+ }
+ if (element?.tidyMarkup !== undefined) {
+ def.tidyMarkup = CamelDefinitionApi.createTidyMarkupDataFormat(element.tidyMarkup);
+ }
+ if (element?.univocityCsv !== undefined) {
+ def.univocityCsv = CamelDefinitionApi.createUniVocityCsvDataFormat(element.univocityCsv);
+ }
+ if (element?.univocityFixed !== undefined) {
+ def.univocityFixed = CamelDefinitionApi.createUniVocityFixedDataFormat(element.univocityFixed);
+ }
+ if (element?.univocityTsv !== undefined) {
+ def.univocityTsv = CamelDefinitionApi.createUniVocityTsvDataFormat(element.univocityTsv);
+ }
+ if (element?.xmlSecurity !== undefined) {
+ def.xmlSecurity = CamelDefinitionApi.createXMLSecurityDataFormat(element.xmlSecurity);
+ }
+ if (element?.yaml !== undefined) {
+ def.yaml = CamelDefinitionApi.createYAMLDataFormat(element.yaml);
+ }
+ if (element?.zipDeflater !== undefined) {
+ def.zipDeflater = CamelDefinitionApi.createZipDeflaterDataFormat(element.zipDeflater);
+ }
+ if (element?.zipFile !== undefined) {
+ def.zipFile = CamelDefinitionApi.createZipFileDataFormat(element.zipFile);
+ }
+ return def;
+ }
+
+ static createMulticastDefinition = (element: any): MulticastDefinition => {
+ const def = element ? new MulticastDefinition({...element}) : new MulticastDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createOnCompletionDefinition = (element: any): OnCompletionDefinition => {
+ const def = element ? new OnCompletionDefinition({...element}) : new OnCompletionDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.onWhen !== undefined) {
+ def.onWhen = CamelDefinitionApi.createOnWhenDefinition(element.onWhen);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createOnExceptionDefinition = (element: any): OnExceptionDefinition => {
+ const def = element ? new OnExceptionDefinition({...element}) : new OnExceptionDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.onWhen !== undefined) {
+ def.onWhen = CamelDefinitionApi.createOnWhenDefinition(element.onWhen);
+ }
+ if (element?.retryWhile !== undefined) {
+ def.retryWhile = CamelDefinitionApi.createExpressionSubElementDefinition(element.retryWhile);
+ }
+ if (element?.redeliveryPolicy !== undefined) {
+ def.redeliveryPolicy = CamelDefinitionApi.createRedeliveryPolicyDefinition(element.redeliveryPolicy);
+ }
+ if (element?.handled !== undefined) {
+ def.handled = CamelDefinitionApi.createExpressionSubElementDefinition(element.handled);
+ }
+ if (element?.continued !== undefined) {
+ def.continued = CamelDefinitionApi.createExpressionSubElementDefinition(element.continued);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createOnFallbackDefinition = (element: any): OnFallbackDefinition => {
+ const def = element ? new OnFallbackDefinition({...element}) : new OnFallbackDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createOnWhenDefinition = (element: any): OnWhenDefinition => {
+ const def = element ? new OnWhenDefinition({...element}) : new OnWhenDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createOptimisticLockRetryPolicyDefinition = (element: any): OptimisticLockRetryPolicyDefinition => {
+ const def = element ? new OptimisticLockRetryPolicyDefinition({...element}) : new OptimisticLockRetryPolicyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createOtherwiseDefinition = (element: any): OtherwiseDefinition => {
+ const def = element ? new OtherwiseDefinition({...element}) : new OtherwiseDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createOutputDefinition = (element: any): OutputDefinition => {
+ const def = element ? new OutputDefinition({...element}) : new OutputDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createOutputTypeDefinition = (element: any): OutputTypeDefinition => {
+ const def = element ? new OutputTypeDefinition({...element}) : new OutputTypeDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPackageScanDefinition = (element: any): PackageScanDefinition => {
+ const def = element ? new PackageScanDefinition({...element}) : new PackageScanDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPausableDefinition = (element: any): PausableDefinition => {
+ const def = element ? new PausableDefinition({...element}) : new PausableDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPipelineDefinition = (element: any): PipelineDefinition => {
+ const def = element ? new PipelineDefinition({...element}) : new PipelineDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createPolicyDefinition = (element: any): PolicyDefinition => {
+ const def = element ? new PolicyDefinition({...element}) : new PolicyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createPollDefinition = (element: any): PollDefinition => {
+ if (element && typeof element === 'string') {
+ element = {uri: element};
+ }
+ const def = element ? new PollDefinition({...element}) : new PollDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPollEnrichDefinition = (element: any): PollEnrichDefinition => {
+ const def = element ? new PollEnrichDefinition({...element}) : new PollEnrichDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createProcessDefinition = (element: any): ProcessDefinition => {
+ const def = element ? new ProcessDefinition({...element}) : new ProcessDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPropertyDefinition = (element: any): PropertyDefinition => {
+ const def = element ? new PropertyDefinition({...element}) : new PropertyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPropertyExpressionDefinition = (element: any): PropertyExpressionDefinition => {
+ const def = element ? new PropertyExpressionDefinition({...element}) : new PropertyExpressionDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createRecipientListDefinition = (element: any): RecipientListDefinition => {
+ const def = element ? new RecipientListDefinition({...element}) : new RecipientListDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createRedeliveryPolicyDefinition = (element: any): RedeliveryPolicyDefinition => {
+ const def = element ? new RedeliveryPolicyDefinition({...element}) : new RedeliveryPolicyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRemoveHeaderDefinition = (element: any): RemoveHeaderDefinition => {
+ if (element && typeof element === 'string') {
+ element = {name: element};
+ }
+ const def = element ? new RemoveHeaderDefinition({...element}) : new RemoveHeaderDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRemoveHeadersDefinition = (element: any): RemoveHeadersDefinition => {
+ if (element && typeof element === 'string') {
+ element = {pattern: element};
+ }
+ const def = element ? new RemoveHeadersDefinition({...element}) : new RemoveHeadersDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRemovePropertiesDefinition = (element: any): RemovePropertiesDefinition => {
+ if (element && typeof element === 'string') {
+ element = {pattern: element};
+ }
+ const def = element ? new RemovePropertiesDefinition({...element}) : new RemovePropertiesDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRemovePropertyDefinition = (element: any): RemovePropertyDefinition => {
+ if (element && typeof element === 'string') {
+ element = {name: element};
+ }
+ const def = element ? new RemovePropertyDefinition({...element}) : new RemovePropertyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ 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;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ if (element?.batchConfig !== undefined) {
+ def.batchConfig = CamelDefinitionApi.createBatchResequencerConfig(element.batchConfig);
+ }
+ if (element?.streamConfig !== undefined) {
+ def.streamConfig = CamelDefinitionApi.createStreamResequencerConfig(element.streamConfig);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createResilience4jConfigurationDefinition = (element: any): Resilience4jConfigurationDefinition => {
+ const def = element ? new Resilience4jConfigurationDefinition({...element}) : new Resilience4jConfigurationDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRestContextRefDefinition = (element: any): RestContextRefDefinition => {
+ if (element && typeof element === 'string') {
+ element = {ref: element};
+ }
+ const def = element ? new RestContextRefDefinition({...element}) : new RestContextRefDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createResumableDefinition = (element: any): ResumableDefinition => {
+ const def = element ? new ResumableDefinition({...element}) : new ResumableDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRollbackDefinition = (element: any): RollbackDefinition => {
+ const def = element ? new RollbackDefinition({...element}) : new RollbackDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRouteBuilderDefinition = (element: any): RouteBuilderDefinition => {
+ if (element && typeof element === 'string') {
+ element = {ref: element};
+ }
+ const def = element ? new RouteBuilderDefinition({...element}) : new RouteBuilderDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRouteConfigurationContextRefDefinition = (element: any): RouteConfigurationContextRefDefinition => {
+ if (element && typeof element === 'string') {
+ element = {ref: element};
+ }
+ const def = element ? new RouteConfigurationContextRefDefinition({...element}) : new RouteConfigurationContextRefDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRouteConfigurationDefinition = (element: any): RouteConfigurationDefinition => {
+ const def = element ? new RouteConfigurationDefinition({...element}) : new RouteConfigurationDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.errorHandler !== undefined) {
+ def.errorHandler = CamelDefinitionApi.createErrorHandlerDefinition(element.errorHandler);
+ }
+ def.intercept = element && element?.intercept ? element?.intercept.map((x:any) => CamelDefinitionApi.createInterceptDefinition(x)) :[];
+ def.interceptFrom = element && element?.interceptFrom ? element?.interceptFrom.map((x:any) => CamelDefinitionApi.createInterceptFromDefinition(x)) :[];
+ def.interceptSendToEndpoint = element && element?.interceptSendToEndpoint ? element?.interceptSendToEndpoint.map((x:any) => CamelDefinitionApi.createInterceptSendToEndpointDefinition(x)) :[];
+ def.onException = element && element?.onException ? element?.onException.map((x:any) => CamelDefinitionApi.createOnExceptionDefinition(x)) :[];
+ def.onCompletion = element && element?.onCompletion ? element?.onCompletion.map((x:any) => CamelDefinitionApi.createOnCompletionDefinition(x)) :[];
+ return def;
+ }
+
+ static createRouteContextRefDefinition = (element: any): RouteContextRefDefinition => {
+ if (element && typeof element === 'string') {
+ element = {ref: element};
+ }
+ const def = element ? new RouteContextRefDefinition({...element}) : new RouteContextRefDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRouteDefinition = (element: any): RouteDefinition => {
+ const def = element ? new RouteDefinition({...element}) : new RouteDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.errorHandler !== undefined) {
+ def.errorHandler = CamelDefinitionApi.createErrorHandlerDefinition(element.errorHandler);
+ }
+ if (element?.inputType !== undefined) {
+ def.inputType = CamelDefinitionApi.createInputTypeDefinition(element.inputType);
+ }
+ if (element?.outputType !== undefined) {
+ def.outputType = CamelDefinitionApi.createOutputTypeDefinition(element.outputType);
+ }
+ if (element?.from !== undefined) {
+ def.from = CamelDefinitionApi.createFromDefinition(element.from);
+ }
+ return def;
+ }
+
+ static createRouteTemplateDefinition = (element: any): RouteTemplateDefinition => {
+ const def = element ? new RouteTemplateDefinition({...element}) : new RouteTemplateDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.route !== undefined) {
+ def.route = CamelDefinitionApi.createRouteDefinition(element.route);
+ }
+ def.beans = element && element?.beans ? element?.beans.map((x:any) => CamelDefinitionApi.createBeanFactoryDefinition(x)) :[];
+ if (element?.from !== undefined) {
+ def.from = CamelDefinitionApi.createFromDefinition(element.from);
+ }
+ def.parameters = element && element?.parameters ? element?.parameters.map((x:any) => CamelDefinitionApi.createRouteTemplateParameterDefinition(x)) :[];
+ return def;
+ }
+
+ static createRouteTemplateParameterDefinition = (element: any): RouteTemplateParameterDefinition => {
+ const def = element ? new RouteTemplateParameterDefinition({...element}) : new RouteTemplateParameterDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRoutingSlipDefinition = (element: any): RoutingSlipDefinition => {
+ const def = element ? new RoutingSlipDefinition({...element}) : new RoutingSlipDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createSagaActionUriDefinition = (element: any): SagaActionUriDefinition => {
+ if (element && typeof element === 'string') {
+ element = {uri: element};
+ }
+ const def = element ? new SagaActionUriDefinition({...element}) : new SagaActionUriDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSagaDefinition = (element: any): SagaDefinition => {
+ const def = element ? new SagaDefinition({...element}) : new SagaDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.option = element && element?.option ? element?.option.map((x:any) => CamelDefinitionApi.createPropertyExpressionDefinition(x)) :[];
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createSamplingDefinition = (element: any): SamplingDefinition => {
+ const def = element ? new SamplingDefinition({...element}) : new SamplingDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createScriptDefinition = (element: any): ScriptDefinition => {
+ const def = element ? new ScriptDefinition({...element}) : new ScriptDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createSetBodyDefinition = (element: any): SetBodyDefinition => {
+ const def = element ? new SetBodyDefinition({...element}) : new SetBodyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createSetExchangePatternDefinition = (element: any): SetExchangePatternDefinition => {
+ const def = element ? new SetExchangePatternDefinition({...element}) : new SetExchangePatternDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSetHeaderDefinition = (element: any): SetHeaderDefinition => {
+ const def = element ? new SetHeaderDefinition({...element}) : new SetHeaderDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createSetHeadersDefinition = (element: any): SetHeadersDefinition => {
+ const def = element ? new SetHeadersDefinition({...element}) : new SetHeadersDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.headers = element && element?.headers ? element?.headers.map((x:any) => CamelDefinitionApi.createSetHeaderDefinition(x)) :[];
+ return def;
+ }
+
+ static createSetPropertyDefinition = (element: any): SetPropertyDefinition => {
+ const def = element ? new SetPropertyDefinition({...element}) : new SetPropertyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ 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 createSetVariablesDefinition = (element: any): SetVariablesDefinition => {
+ const def = element ? new SetVariablesDefinition({...element}) : new SetVariablesDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.variables = element && element?.variables ? element?.variables.map((x:any) => CamelDefinitionApi.createSetVariableDefinition(x)) :[];
+ return def;
+ }
+
+ static createSortDefinition = (element: any): SortDefinition => {
+ const def = element ? new SortDefinition({...element}) : new SortDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createSplitDefinition = (element: any): SplitDefinition => {
+ const def = element ? new SplitDefinition({...element}) : new SplitDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createStepDefinition = (element: any): StepDefinition => {
+ const def = element ? new StepDefinition({...element}) : new StepDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createStopDefinition = (element: any): StopDefinition => {
+ const def = element ? new StopDefinition({...element}) : new StopDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createTemplatedRouteDefinition = (element: any): TemplatedRouteDefinition => {
+ const def = element ? new TemplatedRouteDefinition({...element}) : new TemplatedRouteDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.beans = element && element?.beans ? element?.beans.map((x:any) => CamelDefinitionApi.createBeanFactoryDefinition(x)) :[];
+ def.parameters = element && element?.parameters ? element?.parameters.map((x:any) => CamelDefinitionApi.createTemplatedRouteParameterDefinition(x)) :[];
+ return def;
+ }
+
+ static createTemplatedRouteParameterDefinition = (element: any): TemplatedRouteParameterDefinition => {
+ const def = element ? new TemplatedRouteParameterDefinition({...element}) : new TemplatedRouteParameterDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createThreadPoolProfileDefinition = (element: any): ThreadPoolProfileDefinition => {
+ const def = element ? new ThreadPoolProfileDefinition({...element}) : new ThreadPoolProfileDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createThreadsDefinition = (element: any): ThreadsDefinition => {
+ const def = element ? new ThreadsDefinition({...element}) : new ThreadsDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createThrottleDefinition = (element: any): ThrottleDefinition => {
+ const def = element ? new ThrottleDefinition({...element}) : new ThrottleDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ if (element?.correlationExpression !== undefined) {
+ def.correlationExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.correlationExpression);
+ }
+ return def;
+ }
+
+ static createThrowExceptionDefinition = (element: any): ThrowExceptionDefinition => {
+ const def = element ? new ThrowExceptionDefinition({...element}) : new ThrowExceptionDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createToDefinition = (element: any): ToDefinition => {
+ if (element && typeof element === 'string') {
+ element = {uri: element};
+ }
+ const def = element ? new ToDefinition({...element}) : new ToDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createToDynamicDefinition = (element: any): ToDynamicDefinition => {
+ if (element && typeof element === 'string') {
+ element = {uri: element};
+ }
+ const def = element ? new ToDynamicDefinition({...element}) : new ToDynamicDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createTokenizerDefinition = (element: any): TokenizerDefinition => {
+ const def = element ? new TokenizerDefinition({...element}) : new TokenizerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.langChain4jCharacterTokenizer !== undefined) {
+ def.langChain4jCharacterTokenizer = CamelDefinitionApi.createLangChain4jCharacterTokenizerDefinition(element.langChain4jCharacterTokenizer);
+ }
+ if (element?.langChain4jLineTokenizer !== undefined) {
+ def.langChain4jLineTokenizer = CamelDefinitionApi.createLangChain4jLineTokenizerDefinition(element.langChain4jLineTokenizer);
+ }
+ if (element?.langChain4jParagraphTokenizer !== undefined) {
+ def.langChain4jParagraphTokenizer = CamelDefinitionApi.createLangChain4jParagraphTokenizerDefinition(element.langChain4jParagraphTokenizer);
+ }
+ if (element?.langChain4jSentenceTokenizer !== undefined) {
+ def.langChain4jSentenceTokenizer = CamelDefinitionApi.createLangChain4jSentenceTokenizerDefinition(element.langChain4jSentenceTokenizer);
+ }
+ if (element?.langChain4jWordTokenizer !== undefined) {
+ def.langChain4jWordTokenizer = CamelDefinitionApi.createLangChain4jWordTokenizerDefinition(element.langChain4jWordTokenizer);
+ }
+ return def;
+ }
+
+ static createTokenizerImplementationDefinition = (element: any): TokenizerImplementationDefinition => {
+ const def = element ? new TokenizerImplementationDefinition({...element}) : new TokenizerImplementationDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createTransactedDefinition = (element: any): TransactedDefinition => {
+ const def = element ? new TransactedDefinition({...element}) : new TransactedDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createTransformDefinition = (element: any): TransformDefinition => {
+ const def = element ? new TransformDefinition({...element}) : new TransformDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createTryDefinition = (element: any): TryDefinition => {
+ const def = element ? new TryDefinition({...element}) : new TryDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.doCatch = element && element?.doCatch ? element?.doCatch.map((x:any) => CamelDefinitionApi.createCatchDefinition(x)) :[];
+ if (element?.doFinally !== undefined) {
+ def.doFinally = CamelDefinitionApi.createFinallyDefinition(element.doFinally);
+ }
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createUnmarshalDefinition = (element: any): UnmarshalDefinition => {
+ const def = element ? new UnmarshalDefinition({...element}) : new UnmarshalDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.asn1 !== undefined) {
+ def.asn1 = CamelDefinitionApi.createASN1DataFormat(element.asn1);
+ }
+ if (element?.avro !== undefined) {
+ def.avro = CamelDefinitionApi.createAvroDataFormat(element.avro);
+ }
+ if (element?.barcode !== undefined) {
+ def.barcode = CamelDefinitionApi.createBarcodeDataFormat(element.barcode);
+ }
+ 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);
+ }
+ if (element?.cbor !== undefined) {
+ def.cbor = CamelDefinitionApi.createCBORDataFormat(element.cbor);
+ }
+ if (element?.crypto !== undefined) {
+ def.crypto = CamelDefinitionApi.createCryptoDataFormat(element.crypto);
+ }
+ if (element?.csv !== undefined) {
+ def.csv = CamelDefinitionApi.createCsvDataFormat(element.csv);
+ }
+ if (element?.custom !== undefined) {
+ def.custom = CamelDefinitionApi.createCustomDataFormat(element.custom);
+ }
+ if (element?.dfdl !== undefined) {
+ def.dfdl = CamelDefinitionApi.createDfdlDataFormat(element.dfdl);
+ }
+ if (element?.fhirJson !== undefined) {
+ def.fhirJson = CamelDefinitionApi.createFhirJsonDataFormat(element.fhirJson);
+ }
+ if (element?.fhirXml !== undefined) {
+ def.fhirXml = CamelDefinitionApi.createFhirXmlDataFormat(element.fhirXml);
+ }
+ if (element?.flatpack !== undefined) {
+ def.flatpack = CamelDefinitionApi.createFlatpackDataFormat(element.flatpack);
+ }
+ if (element?.fory !== undefined) {
+ def.fory = CamelDefinitionApi.createForyDataFormat(element.fory);
+ }
+ if (element?.grok !== undefined) {
+ def.grok = CamelDefinitionApi.createGrokDataFormat(element.grok);
+ }
+ if (element?.gzipDeflater !== undefined) {
+ def.gzipDeflater = CamelDefinitionApi.createGzipDeflaterDataFormat(element.gzipDeflater);
+ }
+ if (element?.hl7 !== undefined) {
+ def.hl7 = CamelDefinitionApi.createHL7DataFormat(element.hl7);
+ }
+ if (element?.ical !== undefined) {
+ def.ical = CamelDefinitionApi.createIcalDataFormat(element.ical);
+ }
+ if (element?.iso8583 !== undefined) {
+ def.iso8583 = CamelDefinitionApi.createIso8583DataFormat(element.iso8583);
+ }
+ if (element?.jacksonXml !== undefined) {
+ def.jacksonXml = CamelDefinitionApi.createJacksonXMLDataFormat(element.jacksonXml);
+ }
+ if (element?.jaxb !== undefined) {
+ def.jaxb = CamelDefinitionApi.createJaxbDataFormat(element.jaxb);
+ }
+ if (element?.json !== undefined) {
+ def.json = CamelDefinitionApi.createJsonDataFormat(element.json);
+ }
+ if (element?.jsonApi !== undefined) {
+ def.jsonApi = CamelDefinitionApi.createJsonApiDataFormat(element.jsonApi);
+ }
+ if (element?.lzf !== undefined) {
+ def.lzf = CamelDefinitionApi.createLZFDataFormat(element.lzf);
+ }
+ if (element?.mimeMultipart !== undefined) {
+ def.mimeMultipart = CamelDefinitionApi.createMimeMultipartDataFormat(element.mimeMultipart);
+ }
+ if (element?.parquetAvro !== undefined) {
+ def.parquetAvro = CamelDefinitionApi.createParquetAvroDataFormat(element.parquetAvro);
+ }
+ if (element?.pgp !== undefined) {
+ def.pgp = CamelDefinitionApi.createPGPDataFormat(element.pgp);
+ }
+ if (element?.protobuf !== undefined) {
+ def.protobuf = CamelDefinitionApi.createProtobufDataFormat(element.protobuf);
+ }
+ if (element?.rss !== undefined) {
+ def.rss = CamelDefinitionApi.createRssDataFormat(element.rss);
+ }
+ if (element?.smooks !== undefined) {
+ def.smooks = CamelDefinitionApi.createSmooksDataFormat(element.smooks);
+ }
+ if (element?.soap !== undefined) {
+ def.soap = CamelDefinitionApi.createSoapDataFormat(element.soap);
+ }
+ if (element?.swiftMt !== undefined) {
+ def.swiftMt = CamelDefinitionApi.createSwiftMtDataFormat(element.swiftMt);
+ }
+ if (element?.swiftMx !== undefined) {
+ def.swiftMx = CamelDefinitionApi.createSwiftMxDataFormat(element.swiftMx);
+ }
+ if (element?.syslog !== undefined) {
+ def.syslog = CamelDefinitionApi.createSyslogDataFormat(element.syslog);
+ }
+ if (element?.tarFile !== undefined) {
+ def.tarFile = CamelDefinitionApi.createTarFileDataFormat(element.tarFile);
+ }
+ if (element?.thrift !== undefined) {
+ def.thrift = CamelDefinitionApi.createThriftDataFormat(element.thrift);
+ }
+ if (element?.tidyMarkup !== undefined) {
+ def.tidyMarkup = CamelDefinitionApi.createTidyMarkupDataFormat(element.tidyMarkup);
+ }
+ if (element?.univocityCsv !== undefined) {
+ def.univocityCsv = CamelDefinitionApi.createUniVocityCsvDataFormat(element.univocityCsv);
+ }
+ if (element?.univocityFixed !== undefined) {
+ def.univocityFixed = CamelDefinitionApi.createUniVocityFixedDataFormat(element.univocityFixed);
+ }
+ if (element?.univocityTsv !== undefined) {
+ def.univocityTsv = CamelDefinitionApi.createUniVocityTsvDataFormat(element.univocityTsv);
+ }
+ if (element?.xmlSecurity !== undefined) {
+ def.xmlSecurity = CamelDefinitionApi.createXMLSecurityDataFormat(element.xmlSecurity);
+ }
+ if (element?.yaml !== undefined) {
+ def.yaml = CamelDefinitionApi.createYAMLDataFormat(element.yaml);
+ }
+ if (element?.zipDeflater !== undefined) {
+ def.zipDeflater = CamelDefinitionApi.createZipDeflaterDataFormat(element.zipDeflater);
+ }
+ if (element?.zipFile !== undefined) {
+ def.zipFile = CamelDefinitionApi.createZipFileDataFormat(element.zipFile);
+ }
+ return def;
+ }
+
+ static createValidateDefinition = (element: any): ValidateDefinition => {
+ const def = element ? new ValidateDefinition({...element}) : new ValidateDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createValueDefinition = (element: any): ValueDefinition => {
+ const def = element ? new ValueDefinition({...element}) : new ValueDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createWhenDefinition = (element: any): WhenDefinition => {
+ const def = element ? new WhenDefinition({...element}) : new WhenDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ def.steps = CamelDefinitionApi.createSteps(element?.steps);
+ return def;
+ }
+
+ static createWireTapDefinition = (element: any): WireTapDefinition => {
+ const def = element ? new WireTapDefinition({...element}) : new WireTapDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBeanConstructorDefinition = (element: any): BeanConstructorDefinition => {
+ const def = element ? new BeanConstructorDefinition({...element}) : new BeanConstructorDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBeanConstructorsDefinition = (element: any): BeanConstructorsDefinition => {
+ const def = element ? new BeanConstructorsDefinition({...element}) : new BeanConstructorsDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.constructor = element && element?.constructor ? element?.constructor.map((x:any) => CamelDefinitionApi.createBeanConstructorDefinition(x)) :[];
+ return def;
+ }
+
+ static createBeanPropertiesDefinition = (element: any): BeanPropertiesDefinition => {
+ const def = element ? new BeanPropertiesDefinition({...element}) : new BeanPropertiesDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.property = element && element?.property ? element?.property.map((x:any) => CamelDefinitionApi.createBeanPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createBeanPropertyDefinition = (element: any): BeanPropertyDefinition => {
+ const def = element ? new BeanPropertyDefinition({...element}) : new BeanPropertyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.properties !== undefined) {
+ def.properties = CamelDefinitionApi.createBeanPropertiesDefinition(element.properties);
+ }
+ return def;
+ }
+
+ static createComponentScanDefinition = (element: any): ComponentScanDefinition => {
+ const def = element ? new ComponentScanDefinition({...element}) : new ComponentScanDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBatchResequencerConfig = (element: any): BatchResequencerConfig => {
+ const def = element ? new BatchResequencerConfig({...element}) : new BatchResequencerConfig();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createStreamResequencerConfig = (element: any): StreamResequencerConfig => {
+ const def = element ? new StreamResequencerConfig({...element}) : new StreamResequencerConfig();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createASN1DataFormat = (element: any): ASN1DataFormat => {
+ const def = element ? new ASN1DataFormat({...element}) : new ASN1DataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createAvroDataFormat = (element: any): AvroDataFormat => {
+ const def = element ? new AvroDataFormat({...element}) : new AvroDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBarcodeDataFormat = (element: any): BarcodeDataFormat => {
+ const def = element ? new BarcodeDataFormat({...element}) : new BarcodeDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBase64DataFormat = (element: any): Base64DataFormat => {
+ const def = element ? new Base64DataFormat({...element}) : new Base64DataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ 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;
+ return def;
+ }
+
+ static createCBORDataFormat = (element: any): CBORDataFormat => {
+ const def = element ? new CBORDataFormat({...element}) : new CBORDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createCryptoDataFormat = (element: any): CryptoDataFormat => {
+ const def = element ? new CryptoDataFormat({...element}) : new CryptoDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createCsvDataFormat = (element: any): CsvDataFormat => {
+ const def = element ? new CsvDataFormat({...element}) : new CsvDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createCustomDataFormat = (element: any): CustomDataFormat => {
+ if (element && typeof element === 'string') {
+ element = {ref: element};
+ }
+ const def = element ? new CustomDataFormat({...element}) : new CustomDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createDataFormatsDefinition = (element: any): DataFormatsDefinition => {
+ const def = element ? new DataFormatsDefinition({...element}) : new DataFormatsDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.asn1 !== undefined) {
+ def.asn1 = CamelDefinitionApi.createASN1DataFormat(element.asn1);
+ }
+ if (element?.avro !== undefined) {
+ def.avro = CamelDefinitionApi.createAvroDataFormat(element.avro);
+ }
+ if (element?.barcode !== undefined) {
+ def.barcode = CamelDefinitionApi.createBarcodeDataFormat(element.barcode);
+ }
+ 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);
+ }
+ if (element?.cbor !== undefined) {
+ def.cbor = CamelDefinitionApi.createCBORDataFormat(element.cbor);
+ }
+ if (element?.crypto !== undefined) {
+ def.crypto = CamelDefinitionApi.createCryptoDataFormat(element.crypto);
+ }
+ if (element?.csv !== undefined) {
+ def.csv = CamelDefinitionApi.createCsvDataFormat(element.csv);
+ }
+ if (element?.custom !== undefined) {
+ def.custom = CamelDefinitionApi.createCustomDataFormat(element.custom);
+ }
+ if (element?.dfdl !== undefined) {
+ def.dfdl = CamelDefinitionApi.createDfdlDataFormat(element.dfdl);
+ }
+ if (element?.fhirJson !== undefined) {
+ def.fhirJson = CamelDefinitionApi.createFhirJsonDataFormat(element.fhirJson);
+ }
+ if (element?.fhirXml !== undefined) {
+ def.fhirXml = CamelDefinitionApi.createFhirXmlDataFormat(element.fhirXml);
+ }
+ if (element?.flatpack !== undefined) {
+ def.flatpack = CamelDefinitionApi.createFlatpackDataFormat(element.flatpack);
+ }
+ if (element?.fory !== undefined) {
+ def.fory = CamelDefinitionApi.createForyDataFormat(element.fory);
+ }
+ if (element?.grok !== undefined) {
+ def.grok = CamelDefinitionApi.createGrokDataFormat(element.grok);
+ }
+ if (element?.gzipDeflater !== undefined) {
+ def.gzipDeflater = CamelDefinitionApi.createGzipDeflaterDataFormat(element.gzipDeflater);
+ }
+ if (element?.hl7 !== undefined) {
+ def.hl7 = CamelDefinitionApi.createHL7DataFormat(element.hl7);
+ }
+ if (element?.ical !== undefined) {
+ def.ical = CamelDefinitionApi.createIcalDataFormat(element.ical);
+ }
+ if (element?.iso8583 !== undefined) {
+ def.iso8583 = CamelDefinitionApi.createIso8583DataFormat(element.iso8583);
+ }
+ if (element?.jacksonXml !== undefined) {
+ def.jacksonXml = CamelDefinitionApi.createJacksonXMLDataFormat(element.jacksonXml);
+ }
+ if (element?.jaxb !== undefined) {
+ def.jaxb = CamelDefinitionApi.createJaxbDataFormat(element.jaxb);
+ }
+ if (element?.json !== undefined) {
+ def.json = CamelDefinitionApi.createJsonDataFormat(element.json);
+ }
+ if (element?.jsonApi !== undefined) {
+ def.jsonApi = CamelDefinitionApi.createJsonApiDataFormat(element.jsonApi);
+ }
+ if (element?.lzf !== undefined) {
+ def.lzf = CamelDefinitionApi.createLZFDataFormat(element.lzf);
+ }
+ if (element?.mimeMultipart !== undefined) {
+ def.mimeMultipart = CamelDefinitionApi.createMimeMultipartDataFormat(element.mimeMultipart);
+ }
+ if (element?.parquetAvro !== undefined) {
+ def.parquetAvro = CamelDefinitionApi.createParquetAvroDataFormat(element.parquetAvro);
+ }
+ if (element?.pgp !== undefined) {
+ def.pgp = CamelDefinitionApi.createPGPDataFormat(element.pgp);
+ }
+ if (element?.protobuf !== undefined) {
+ def.protobuf = CamelDefinitionApi.createProtobufDataFormat(element.protobuf);
+ }
+ if (element?.rss !== undefined) {
+ def.rss = CamelDefinitionApi.createRssDataFormat(element.rss);
+ }
+ if (element?.smooks !== undefined) {
+ def.smooks = CamelDefinitionApi.createSmooksDataFormat(element.smooks);
+ }
+ if (element?.soap !== undefined) {
+ def.soap = CamelDefinitionApi.createSoapDataFormat(element.soap);
+ }
+ if (element?.swiftMt !== undefined) {
+ def.swiftMt = CamelDefinitionApi.createSwiftMtDataFormat(element.swiftMt);
+ }
+ if (element?.swiftMx !== undefined) {
+ def.swiftMx = CamelDefinitionApi.createSwiftMxDataFormat(element.swiftMx);
+ }
+ if (element?.syslog !== undefined) {
+ def.syslog = CamelDefinitionApi.createSyslogDataFormat(element.syslog);
+ }
+ if (element?.tarFile !== undefined) {
+ def.tarFile = CamelDefinitionApi.createTarFileDataFormat(element.tarFile);
+ }
+ if (element?.thrift !== undefined) {
+ def.thrift = CamelDefinitionApi.createThriftDataFormat(element.thrift);
+ }
+ if (element?.tidyMarkup !== undefined) {
+ def.tidyMarkup = CamelDefinitionApi.createTidyMarkupDataFormat(element.tidyMarkup);
+ }
+ if (element?.univocityCsv !== undefined) {
+ def.univocityCsv = CamelDefinitionApi.createUniVocityCsvDataFormat(element.univocityCsv);
+ }
+ if (element?.univocityFixed !== undefined) {
+ def.univocityFixed = CamelDefinitionApi.createUniVocityFixedDataFormat(element.univocityFixed);
+ }
+ if (element?.univocityTsv !== undefined) {
+ def.univocityTsv = CamelDefinitionApi.createUniVocityTsvDataFormat(element.univocityTsv);
+ }
+ if (element?.xmlSecurity !== undefined) {
+ def.xmlSecurity = CamelDefinitionApi.createXMLSecurityDataFormat(element.xmlSecurity);
+ }
+ if (element?.yaml !== undefined) {
+ def.yaml = CamelDefinitionApi.createYAMLDataFormat(element.yaml);
+ }
+ if (element?.zipDeflater !== undefined) {
+ def.zipDeflater = CamelDefinitionApi.createZipDeflaterDataFormat(element.zipDeflater);
+ }
+ if (element?.zipFile !== undefined) {
+ def.zipFile = CamelDefinitionApi.createZipFileDataFormat(element.zipFile);
+ }
+ return def;
+ }
+
+ static createDfdlDataFormat = (element: any): DfdlDataFormat => {
+ if (element && typeof element === 'string') {
+ element = {schemaUri: element};
+ }
+ const def = element ? new DfdlDataFormat({...element}) : new DfdlDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createFhirJsonDataFormat = (element: any): FhirJsonDataFormat => {
+ const def = element ? new FhirJsonDataFormat({...element}) : new FhirJsonDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createFhirXmlDataFormat = (element: any): FhirXmlDataFormat => {
+ const def = element ? new FhirXmlDataFormat({...element}) : new FhirXmlDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createFlatpackDataFormat = (element: any): FlatpackDataFormat => {
+ const def = element ? new FlatpackDataFormat({...element}) : new FlatpackDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createForyDataFormat = (element: any): ForyDataFormat => {
+ const def = element ? new ForyDataFormat({...element}) : new ForyDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createGrokDataFormat = (element: any): GrokDataFormat => {
+ const def = element ? new GrokDataFormat({...element}) : new GrokDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createGzipDeflaterDataFormat = (element: any): GzipDeflaterDataFormat => {
+ const def = element ? new GzipDeflaterDataFormat({...element}) : new GzipDeflaterDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createHL7DataFormat = (element: any): HL7DataFormat => {
+ const def = element ? new HL7DataFormat({...element}) : new HL7DataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createIcalDataFormat = (element: any): IcalDataFormat => {
+ const def = element ? new IcalDataFormat({...element}) : new IcalDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createIso8583DataFormat = (element: any): Iso8583DataFormat => {
+ const def = element ? new Iso8583DataFormat({...element}) : new Iso8583DataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJacksonXMLDataFormat = (element: any): JacksonXMLDataFormat => {
+ const def = element ? new JacksonXMLDataFormat({...element}) : new JacksonXMLDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJaxbDataFormat = (element: any): JaxbDataFormat => {
+ const def = element ? new JaxbDataFormat({...element}) : new JaxbDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJsonApiDataFormat = (element: any): JsonApiDataFormat => {
+ const def = element ? new JsonApiDataFormat({...element}) : new JsonApiDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJsonDataFormat = (element: any): JsonDataFormat => {
+ const def = element ? new JsonDataFormat({...element}) : new JsonDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLZFDataFormat = (element: any): LZFDataFormat => {
+ const def = element ? new LZFDataFormat({...element}) : new LZFDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createMimeMultipartDataFormat = (element: any): MimeMultipartDataFormat => {
+ const def = element ? new MimeMultipartDataFormat({...element}) : new MimeMultipartDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPGPDataFormat = (element: any): PGPDataFormat => {
+ const def = element ? new PGPDataFormat({...element}) : new PGPDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createParquetAvroDataFormat = (element: any): ParquetAvroDataFormat => {
+ const def = element ? new ParquetAvroDataFormat({...element}) : new ParquetAvroDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createProtobufDataFormat = (element: any): ProtobufDataFormat => {
+ const def = element ? new ProtobufDataFormat({...element}) : new ProtobufDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRssDataFormat = (element: any): RssDataFormat => {
+ const def = element ? new RssDataFormat({...element}) : new RssDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSmooksDataFormat = (element: any): SmooksDataFormat => {
+ const def = element ? new SmooksDataFormat({...element}) : new SmooksDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSoapDataFormat = (element: any): SoapDataFormat => {
+ if (element && typeof element === 'string') {
+ element = {contextPath: element};
+ }
+ const def = element ? new SoapDataFormat({...element}) : new SoapDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSwiftMtDataFormat = (element: any): SwiftMtDataFormat => {
+ const def = element ? new SwiftMtDataFormat({...element}) : new SwiftMtDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSwiftMxDataFormat = (element: any): SwiftMxDataFormat => {
+ const def = element ? new SwiftMxDataFormat({...element}) : new SwiftMxDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSyslogDataFormat = (element: any): SyslogDataFormat => {
+ const def = element ? new SyslogDataFormat({...element}) : new SyslogDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createTarFileDataFormat = (element: any): TarFileDataFormat => {
+ const def = element ? new TarFileDataFormat({...element}) : new TarFileDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createThriftDataFormat = (element: any): ThriftDataFormat => {
+ const def = element ? new ThriftDataFormat({...element}) : new ThriftDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createTidyMarkupDataFormat = (element: any): TidyMarkupDataFormat => {
+ const def = element ? new TidyMarkupDataFormat({...element}) : new TidyMarkupDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createUniVocityCsvDataFormat = (element: any): UniVocityCsvDataFormat => {
+ const def = element ? new UniVocityCsvDataFormat({...element}) : new UniVocityCsvDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.univocityHeader = element && element?.univocityHeader ? element?.univocityHeader.map((x:any) => CamelDefinitionApi.createUniVocityHeader(x)) :[];
+ return def;
+ }
+
+ static createUniVocityFixedDataFormat = (element: any): UniVocityFixedDataFormat => {
+ const def = element ? new UniVocityFixedDataFormat({...element}) : new UniVocityFixedDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.univocityHeader = element && element?.univocityHeader ? element?.univocityHeader.map((x:any) => CamelDefinitionApi.createUniVocityHeader(x)) :[];
+ return def;
+ }
+
+ static createUniVocityHeader = (element: any): UniVocityHeader => {
+ const def = element ? new UniVocityHeader({...element}) : new UniVocityHeader();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createUniVocityTsvDataFormat = (element: any): UniVocityTsvDataFormat => {
+ const def = element ? new UniVocityTsvDataFormat({...element}) : new UniVocityTsvDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.univocityHeader = element && element?.univocityHeader ? element?.univocityHeader.map((x:any) => CamelDefinitionApi.createUniVocityHeader(x)) :[];
+ return def;
+ }
+
+ static createXMLSecurityDataFormat = (element: any): XMLSecurityDataFormat => {
+ const def = element ? new XMLSecurityDataFormat({...element}) : new XMLSecurityDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createYAMLDataFormat = (element: any): YAMLDataFormat => {
+ const def = element ? new YAMLDataFormat({...element}) : new YAMLDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.typeFilter = element && element?.typeFilter ? element?.typeFilter.map((x:any) => CamelDefinitionApi.createYAMLTypeFilterDefinition(x)) :[];
+ return def;
+ }
+
+ static createYAMLTypeFilterDefinition = (element: any): YAMLTypeFilterDefinition => {
+ const def = element ? new YAMLTypeFilterDefinition({...element}) : new YAMLTypeFilterDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createZipDeflaterDataFormat = (element: any): ZipDeflaterDataFormat => {
+ const def = element ? new ZipDeflaterDataFormat({...element}) : new ZipDeflaterDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createZipFileDataFormat = (element: any): ZipFileDataFormat => {
+ const def = element ? new ZipFileDataFormat({...element}) : new ZipFileDataFormat();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createDeadLetterChannelDefinition = (element: any): DeadLetterChannelDefinition => {
+ const def = element ? new DeadLetterChannelDefinition({...element}) : new DeadLetterChannelDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.redeliveryPolicy !== undefined) {
+ def.redeliveryPolicy = CamelDefinitionApi.createRedeliveryPolicyDefinition(element.redeliveryPolicy);
+ }
+ return def;
+ }
+
+ static createDefaultErrorHandlerDefinition = (element: any): DefaultErrorHandlerDefinition => {
+ const def = element ? new DefaultErrorHandlerDefinition({...element}) : new DefaultErrorHandlerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.redeliveryPolicy !== undefined) {
+ def.redeliveryPolicy = CamelDefinitionApi.createRedeliveryPolicyDefinition(element.redeliveryPolicy);
+ }
+ return def;
+ }
+
+ static createJtaTransactionErrorHandlerDefinition = (element: any): JtaTransactionErrorHandlerDefinition => {
+ const def = element ? new JtaTransactionErrorHandlerDefinition({...element}) : new JtaTransactionErrorHandlerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.redeliveryPolicy !== undefined) {
+ def.redeliveryPolicy = CamelDefinitionApi.createRedeliveryPolicyDefinition(element.redeliveryPolicy);
+ }
+ return def;
+ }
+
+ static createNoErrorHandlerDefinition = (element: any): NoErrorHandlerDefinition => {
+ const def = element ? new NoErrorHandlerDefinition({...element}) : new NoErrorHandlerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRefErrorHandlerDefinition = (element: any): RefErrorHandlerDefinition => {
+ if (element && typeof element === 'string') {
+ element = {ref: element};
+ }
+ const def = element ? new RefErrorHandlerDefinition({...element}) : new RefErrorHandlerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSpringTransactionErrorHandlerDefinition = (element: any): SpringTransactionErrorHandlerDefinition => {
+ const def = element ? new SpringTransactionErrorHandlerDefinition({...element}) : new SpringTransactionErrorHandlerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.redeliveryPolicy !== undefined) {
+ def.redeliveryPolicy = CamelDefinitionApi.createRedeliveryPolicyDefinition(element.redeliveryPolicy);
+ }
+ return def;
+ }
+
+ static createCSimpleExpression = (element: any): CSimpleExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new CSimpleExpression({...element}) : new CSimpleExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createConstantExpression = (element: any): ConstantExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new ConstantExpression({...element}) : new ConstantExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createDatasonnetExpression = (element: any): DatasonnetExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new DatasonnetExpression({...element}) : new DatasonnetExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createExchangePropertyExpression = (element: any): ExchangePropertyExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new ExchangePropertyExpression({...element}) : new ExchangePropertyExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createExpressionDefinition = (element: any): ExpressionDefinition => {
+ const def = element ? new ExpressionDefinition({...element}) : new ExpressionDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ element = element !== undefined ? element : {groovy: CamelDefinitionApi.createGroovyExpression({expression: ""})}
+ if (element?.constant !== undefined) {
+ def.constant = CamelDefinitionApi.createConstantExpression(element.constant);
+ }
+ if (element?.csimple !== undefined) {
+ def.csimple = CamelDefinitionApi.createCSimpleExpression(element.csimple);
+ }
+ if (element?.datasonnet !== undefined) {
+ def.datasonnet = CamelDefinitionApi.createDatasonnetExpression(element.datasonnet);
+ }
+ if (element?.exchangeProperty !== undefined) {
+ def.exchangeProperty = CamelDefinitionApi.createExchangePropertyExpression(element.exchangeProperty);
+ }
+ if (element?.groovy !== undefined) {
+ def.groovy = CamelDefinitionApi.createGroovyExpression(element.groovy);
+ }
+ if (element?.header !== undefined) {
+ def.header = CamelDefinitionApi.createHeaderExpression(element.header);
+ }
+ if (element?.hl7terser !== undefined) {
+ def.hl7terser = CamelDefinitionApi.createHl7TerserExpression(element.hl7terser);
+ }
+ if (element?.java !== undefined) {
+ def.java = CamelDefinitionApi.createJavaExpression(element.java);
+ }
+ if (element?.jq !== undefined) {
+ def.jq = CamelDefinitionApi.createJqExpression(element.jq);
+ }
+ if (element?.js !== undefined) {
+ def.js = CamelDefinitionApi.createJavaScriptExpression(element.js);
+ }
+ if (element?.jsonpath !== undefined) {
+ def.jsonpath = CamelDefinitionApi.createJsonPathExpression(element.jsonpath);
+ }
+ if (element?.language !== undefined) {
+ def.language = CamelDefinitionApi.createLanguageExpression(element.language);
+ }
+ if (element?.method !== undefined) {
+ def.method = CamelDefinitionApi.createMethodCallExpression(element.method);
+ }
+ if (element?.mvel !== undefined) {
+ def.mvel = CamelDefinitionApi.createMvelExpression(element.mvel);
+ }
+ if (element?.python !== undefined) {
+ def.python = CamelDefinitionApi.createPythonExpression(element.python);
+ }
+ if (element?.ref !== undefined) {
+ def.ref = CamelDefinitionApi.createRefExpression(element.ref);
+ }
+ if (element?.simple !== undefined) {
+ def.simple = CamelDefinitionApi.createSimpleExpression(element.simple);
+ }
+ if (element?.spel !== undefined) {
+ def.spel = CamelDefinitionApi.createSpELExpression(element.spel);
+ }
+ 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);
+ }
+ if (element?.xquery !== undefined) {
+ def.xquery = CamelDefinitionApi.createXQueryExpression(element.xquery);
+ }
+ if (element?.xtokenize !== undefined) {
+ def.xtokenize = CamelDefinitionApi.createXMLTokenizerExpression(element.xtokenize);
+ }
+ return def;
+ }
+
+ static createGroovyExpression = (element: any): GroovyExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new GroovyExpression({...element}) : new GroovyExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createHeaderExpression = (element: any): HeaderExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new HeaderExpression({...element}) : new HeaderExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createHl7TerserExpression = (element: any): Hl7TerserExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new Hl7TerserExpression({...element}) : new Hl7TerserExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJavaExpression = (element: any): JavaExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new JavaExpression({...element}) : new JavaExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJavaScriptExpression = (element: any): JavaScriptExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new JavaScriptExpression({...element}) : new JavaScriptExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJqExpression = (element: any): JqExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new JqExpression({...element}) : new JqExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createJsonPathExpression = (element: any): JsonPathExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new JsonPathExpression({...element}) : new JsonPathExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLanguageExpression = (element: any): LanguageExpression => {
+ const def = element ? new LanguageExpression({...element}) : new LanguageExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createMethodCallExpression = (element: any): MethodCallExpression => {
+ const def = element ? new MethodCallExpression({...element}) : new MethodCallExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createMvelExpression = (element: any): MvelExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new MvelExpression({...element}) : new MvelExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPythonExpression = (element: any): PythonExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new PythonExpression({...element}) : new PythonExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRefExpression = (element: any): RefExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new RefExpression({...element}) : new RefExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSimpleExpression = (element: any): SimpleExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new SimpleExpression({...element}) : new SimpleExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createSpELExpression = (element: any): SpELExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new SpELExpression({...element}) : new SpELExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createTokenizerExpression = (element: any): TokenizerExpression => {
+ if (element && typeof element === 'string') {
+ element = {token: element};
+ }
+ const def = element ? new TokenizerExpression({...element}) : new TokenizerExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ 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};
+ }
+ const def = element ? new XMLTokenizerExpression({...element}) : new XMLTokenizerExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.namespace = element && element?.namespace ? element?.namespace.map((x:any) => CamelDefinitionApi.createPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createXPathExpression = (element: any): XPathExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new XPathExpression({...element}) : new XPathExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.namespace = element && element?.namespace ? element?.namespace.map((x:any) => CamelDefinitionApi.createPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createXQueryExpression = (element: any): XQueryExpression => {
+ if (element && typeof element === 'string') {
+ element = {expression: element};
+ }
+ const def = element ? new XQueryExpression({...element}) : new XQueryExpression();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.namespace = element && element?.namespace ? element?.namespace.map((x:any) => CamelDefinitionApi.createPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createCustomLoadBalancerDefinition = (element: any): CustomLoadBalancerDefinition => {
+ if (element && typeof element === 'string') {
+ element = {ref: element};
+ }
+ const def = element ? new CustomLoadBalancerDefinition({...element}) : new CustomLoadBalancerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createFailoverLoadBalancerDefinition = (element: any): FailoverLoadBalancerDefinition => {
+ const def = element ? new FailoverLoadBalancerDefinition({...element}) : new FailoverLoadBalancerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRandomLoadBalancerDefinition = (element: any): RandomLoadBalancerDefinition => {
+ const def = element ? new RandomLoadBalancerDefinition({...element}) : new RandomLoadBalancerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRoundRobinLoadBalancerDefinition = (element: any): RoundRobinLoadBalancerDefinition => {
+ const def = element ? new RoundRobinLoadBalancerDefinition({...element}) : new RoundRobinLoadBalancerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createStickyLoadBalancerDefinition = (element: any): StickyLoadBalancerDefinition => {
+ const def = element ? new StickyLoadBalancerDefinition({...element}) : new StickyLoadBalancerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.correlationExpression !== undefined) {
+ def.correlationExpression = CamelDefinitionApi.createExpressionSubElementDefinition(element.correlationExpression);
+ }
+ return def;
+ }
+
+ static createTopicLoadBalancerDefinition = (element: any): TopicLoadBalancerDefinition => {
+ const def = element ? new TopicLoadBalancerDefinition({...element}) : new TopicLoadBalancerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createWeightedLoadBalancerDefinition = (element: any): WeightedLoadBalancerDefinition => {
+ const def = element ? new WeightedLoadBalancerDefinition({...element}) : new WeightedLoadBalancerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createApiKeyDefinition = (element: any): ApiKeyDefinition => {
+ const def = element ? new ApiKeyDefinition({...element}) : new ApiKeyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBasicAuthDefinition = (element: any): BasicAuthDefinition => {
+ const def = element ? new BasicAuthDefinition({...element}) : new BasicAuthDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createBearerTokenDefinition = (element: any): BearerTokenDefinition => {
+ const def = element ? new BearerTokenDefinition({...element}) : new BearerTokenDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createDeleteDefinition = (element: any): DeleteDefinition => {
+ const def = element ? new DeleteDefinition({...element}) : new DeleteDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.param = element && element?.param ? element?.param.map((x:any) => CamelDefinitionApi.createParamDefinition(x)) :[];
+ def.responseMessage = element && element?.responseMessage ? element?.responseMessage.map((x:any) => CamelDefinitionApi.createResponseMessageDefinition(x)) :[];
+ def.security = element && element?.security ? element?.security.map((x:any) => CamelDefinitionApi.createSecurityDefinition(x)) :[];
+ return def;
+ }
+
+ static createGetDefinition = (element: any): GetDefinition => {
+ const def = element ? new GetDefinition({...element}) : new GetDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.param = element && element?.param ? element?.param.map((x:any) => CamelDefinitionApi.createParamDefinition(x)) :[];
+ def.responseMessage = element && element?.responseMessage ? element?.responseMessage.map((x:any) => CamelDefinitionApi.createResponseMessageDefinition(x)) :[];
+ def.security = element && element?.security ? element?.security.map((x:any) => CamelDefinitionApi.createSecurityDefinition(x)) :[];
+ return def;
+ }
+
+ static createHeadDefinition = (element: any): HeadDefinition => {
+ const def = element ? new HeadDefinition({...element}) : new HeadDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.param = element && element?.param ? element?.param.map((x:any) => CamelDefinitionApi.createParamDefinition(x)) :[];
+ def.responseMessage = element && element?.responseMessage ? element?.responseMessage.map((x:any) => CamelDefinitionApi.createResponseMessageDefinition(x)) :[];
+ def.security = element && element?.security ? element?.security.map((x:any) => CamelDefinitionApi.createSecurityDefinition(x)) :[];
+ return def;
+ }
+
+ static createMutualTLSDefinition = (element: any): MutualTLSDefinition => {
+ const def = element ? new MutualTLSDefinition({...element}) : new MutualTLSDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createOAuth2Definition = (element: any): OAuth2Definition => {
+ const def = element ? new OAuth2Definition({...element}) : new OAuth2Definition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.scopes = element && element?.scopes ? element?.scopes.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createOpenApiDefinition = (element: any): OpenApiDefinition => {
+ const def = element ? new OpenApiDefinition({...element}) : new OpenApiDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createOpenIdConnectDefinition = (element: any): OpenIdConnectDefinition => {
+ const def = element ? new OpenIdConnectDefinition({...element}) : new OpenIdConnectDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createParamDefinition = (element: any): ParamDefinition => {
+ const def = element ? new ParamDefinition({...element}) : new ParamDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.examples = element && element?.examples ? element?.examples.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createPatchDefinition = (element: any): PatchDefinition => {
+ const def = element ? new PatchDefinition({...element}) : new PatchDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.param = element && element?.param ? element?.param.map((x:any) => CamelDefinitionApi.createParamDefinition(x)) :[];
+ def.responseMessage = element && element?.responseMessage ? element?.responseMessage.map((x:any) => CamelDefinitionApi.createResponseMessageDefinition(x)) :[];
+ def.security = element && element?.security ? element?.security.map((x:any) => CamelDefinitionApi.createSecurityDefinition(x)) :[];
+ return def;
+ }
+
+ static createPostDefinition = (element: any): PostDefinition => {
+ const def = element ? new PostDefinition({...element}) : new PostDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.param = element && element?.param ? element?.param.map((x:any) => CamelDefinitionApi.createParamDefinition(x)) :[];
+ def.responseMessage = element && element?.responseMessage ? element?.responseMessage.map((x:any) => CamelDefinitionApi.createResponseMessageDefinition(x)) :[];
+ def.security = element && element?.security ? element?.security.map((x:any) => CamelDefinitionApi.createSecurityDefinition(x)) :[];
+ return def;
+ }
+
+ static createPutDefinition = (element: any): PutDefinition => {
+ const def = element ? new PutDefinition({...element}) : new PutDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.param = element && element?.param ? element?.param.map((x:any) => CamelDefinitionApi.createParamDefinition(x)) :[];
+ def.responseMessage = element && element?.responseMessage ? element?.responseMessage.map((x:any) => CamelDefinitionApi.createResponseMessageDefinition(x)) :[];
+ def.security = element && element?.security ? element?.security.map((x:any) => CamelDefinitionApi.createSecurityDefinition(x)) :[];
+ return def;
+ }
+
+ static createResponseHeaderDefinition = (element: any): ResponseHeaderDefinition => {
+ const def = element ? new ResponseHeaderDefinition({...element}) : new ResponseHeaderDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createResponseMessageDefinition = (element: any): ResponseMessageDefinition => {
+ const def = element ? new ResponseMessageDefinition({...element}) : new ResponseMessageDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.header = element && element?.header ? element?.header.map((x:any) => CamelDefinitionApi.createResponseHeaderDefinition(x)) :[];
+ def.examples = element && element?.examples ? element?.examples.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createRestBindingDefinition = (element: any): RestBindingDefinition => {
+ const def = element ? new RestBindingDefinition({...element}) : new RestBindingDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRestConfigurationDefinition = (element: any): RestConfigurationDefinition => {
+ const def = element ? new RestConfigurationDefinition({...element}) : new RestConfigurationDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.componentProperty = element && element?.componentProperty ? element?.componentProperty.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ def.endpointProperty = element && element?.endpointProperty ? element?.endpointProperty.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ def.consumerProperty = element && element?.consumerProperty ? element?.consumerProperty.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ def.dataFormatProperty = element && element?.dataFormatProperty ? element?.dataFormatProperty.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ def.apiProperty = element && element?.apiProperty ? element?.apiProperty.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ def.corsHeaders = element && element?.corsHeaders ? element?.corsHeaders.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ def.validationLevels = element && element?.validationLevels ? element?.validationLevels.map((x:any) => CamelDefinitionApi.createRestPropertyDefinition(x)) :[];
+ return def;
+ }
+
+ static createRestDefinition = (element: any): RestDefinition => {
+ const def = element ? new RestDefinition({...element}) : new RestDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.openApi !== undefined) {
+ def.openApi = CamelDefinitionApi.createOpenApiDefinition(element.openApi);
+ }
+ if (element?.securityDefinitions !== undefined) {
+ def.securityDefinitions = CamelDefinitionApi.createRestSecuritiesDefinition(element.securityDefinitions);
+ }
+ def.securityRequirements = element && element?.securityRequirements ? element?.securityRequirements.map((x:any) => CamelDefinitionApi.createSecurityDefinition(x)) :[];
+ def.delete = element && element?.delete ? element?.delete.map((x:any) => CamelDefinitionApi.createDeleteDefinition(x)) :[];
+ def.get = element && element?.get ? element?.get.map((x:any) => CamelDefinitionApi.createGetDefinition(x)) :[];
+ def.head = element && element?.head ? element?.head.map((x:any) => CamelDefinitionApi.createHeadDefinition(x)) :[];
+ def.patch = element && element?.patch ? element?.patch.map((x:any) => CamelDefinitionApi.createPatchDefinition(x)) :[];
+ def.post = element && element?.post ? element?.post.map((x:any) => CamelDefinitionApi.createPostDefinition(x)) :[];
+ def.put = element && element?.put ? element?.put.map((x:any) => CamelDefinitionApi.createPutDefinition(x)) :[];
+ return def;
+ }
+
+ static createRestPropertyDefinition = (element: any): RestPropertyDefinition => {
+ const def = element ? new RestPropertyDefinition({...element}) : new RestPropertyDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createRestSecuritiesDefinition = (element: any): RestSecuritiesDefinition => {
+ const def = element ? new RestSecuritiesDefinition({...element}) : new RestSecuritiesDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.apiKey !== undefined) {
+ def.apiKey = CamelDefinitionApi.createApiKeyDefinition(element.apiKey);
+ }
+ if (element?.basicAuth !== undefined) {
+ def.basicAuth = CamelDefinitionApi.createBasicAuthDefinition(element.basicAuth);
+ }
+ if (element?.bearerToken !== undefined) {
+ def.bearerToken = CamelDefinitionApi.createBearerTokenDefinition(element.bearerToken);
+ }
+ if (element?.mutualTLS !== undefined) {
+ def.mutualTLS = CamelDefinitionApi.createMutualTLSDefinition(element.mutualTLS);
+ }
+ if (element?.oauth2 !== undefined) {
+ def.oauth2 = CamelDefinitionApi.createOAuth2Definition(element.oauth2);
+ }
+ if (element?.openIdConnect !== undefined) {
+ def.openIdConnect = CamelDefinitionApi.createOpenIdConnectDefinition(element.openIdConnect);
+ }
+ return def;
+ }
+
+ static createRestsDefinition = (element: any): RestsDefinition => {
+ const def = element ? new RestsDefinition({...element}) : new RestsDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.rest = element && element?.rest ? element?.rest.map((x:any) => CamelDefinitionApi.createRestDefinition(x)) :[];
+ return def;
+ }
+
+ static createSecurityDefinition = (element: any): SecurityDefinition => {
+ const def = element ? new SecurityDefinition({...element}) : new SecurityDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLangChain4jCharacterTokenizerDefinition = (element: any): LangChain4jCharacterTokenizerDefinition => {
+ const def = element ? new LangChain4jCharacterTokenizerDefinition({...element}) : new LangChain4jCharacterTokenizerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLangChain4jLineTokenizerDefinition = (element: any): LangChain4jLineTokenizerDefinition => {
+ const def = element ? new LangChain4jLineTokenizerDefinition({...element}) : new LangChain4jLineTokenizerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLangChain4jParagraphTokenizerDefinition = (element: any): LangChain4jParagraphTokenizerDefinition => {
+ const def = element ? new LangChain4jParagraphTokenizerDefinition({...element}) : new LangChain4jParagraphTokenizerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLangChain4jSentenceTokenizerDefinition = (element: any): LangChain4jSentenceTokenizerDefinition => {
+ const def = element ? new LangChain4jSentenceTokenizerDefinition({...element}) : new LangChain4jSentenceTokenizerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLangChain4jTokenizerDefinition = (element: any): LangChain4jTokenizerDefinition => {
+ const def = element ? new LangChain4jTokenizerDefinition({...element}) : new LangChain4jTokenizerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLangChain4jWordTokenizerDefinition = (element: any): LangChain4jWordTokenizerDefinition => {
+ const def = element ? new LangChain4jWordTokenizerDefinition({...element}) : new LangChain4jWordTokenizerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createCustomTransformerDefinition = (element: any): CustomTransformerDefinition => {
+ const def = element ? new CustomTransformerDefinition({...element}) : new CustomTransformerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createDataFormatTransformerDefinition = (element: any): DataFormatTransformerDefinition => {
+ const def = element ? new DataFormatTransformerDefinition({...element}) : new DataFormatTransformerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.asn1 !== undefined) {
+ def.asn1 = CamelDefinitionApi.createASN1DataFormat(element.asn1);
+ }
+ if (element?.avro !== undefined) {
+ def.avro = CamelDefinitionApi.createAvroDataFormat(element.avro);
+ }
+ if (element?.barcode !== undefined) {
+ def.barcode = CamelDefinitionApi.createBarcodeDataFormat(element.barcode);
+ }
+ 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);
+ }
+ if (element?.cbor !== undefined) {
+ def.cbor = CamelDefinitionApi.createCBORDataFormat(element.cbor);
+ }
+ if (element?.crypto !== undefined) {
+ def.crypto = CamelDefinitionApi.createCryptoDataFormat(element.crypto);
+ }
+ if (element?.csv !== undefined) {
+ def.csv = CamelDefinitionApi.createCsvDataFormat(element.csv);
+ }
+ if (element?.custom !== undefined) {
+ def.custom = CamelDefinitionApi.createCustomDataFormat(element.custom);
+ }
+ if (element?.dfdl !== undefined) {
+ def.dfdl = CamelDefinitionApi.createDfdlDataFormat(element.dfdl);
+ }
+ if (element?.fhirJson !== undefined) {
+ def.fhirJson = CamelDefinitionApi.createFhirJsonDataFormat(element.fhirJson);
+ }
+ if (element?.fhirXml !== undefined) {
+ def.fhirXml = CamelDefinitionApi.createFhirXmlDataFormat(element.fhirXml);
+ }
+ if (element?.flatpack !== undefined) {
+ def.flatpack = CamelDefinitionApi.createFlatpackDataFormat(element.flatpack);
+ }
+ if (element?.fory !== undefined) {
+ def.fory = CamelDefinitionApi.createForyDataFormat(element.fory);
+ }
+ if (element?.grok !== undefined) {
+ def.grok = CamelDefinitionApi.createGrokDataFormat(element.grok);
+ }
+ if (element?.gzipDeflater !== undefined) {
+ def.gzipDeflater = CamelDefinitionApi.createGzipDeflaterDataFormat(element.gzipDeflater);
+ }
+ if (element?.hl7 !== undefined) {
+ def.hl7 = CamelDefinitionApi.createHL7DataFormat(element.hl7);
+ }
+ if (element?.ical !== undefined) {
+ def.ical = CamelDefinitionApi.createIcalDataFormat(element.ical);
+ }
+ if (element?.iso8583 !== undefined) {
+ def.iso8583 = CamelDefinitionApi.createIso8583DataFormat(element.iso8583);
+ }
+ if (element?.jacksonXml !== undefined) {
+ def.jacksonXml = CamelDefinitionApi.createJacksonXMLDataFormat(element.jacksonXml);
+ }
+ if (element?.jaxb !== undefined) {
+ def.jaxb = CamelDefinitionApi.createJaxbDataFormat(element.jaxb);
+ }
+ if (element?.json !== undefined) {
+ def.json = CamelDefinitionApi.createJsonDataFormat(element.json);
+ }
+ if (element?.jsonApi !== undefined) {
+ def.jsonApi = CamelDefinitionApi.createJsonApiDataFormat(element.jsonApi);
+ }
+ if (element?.lzf !== undefined) {
+ def.lzf = CamelDefinitionApi.createLZFDataFormat(element.lzf);
+ }
+ if (element?.mimeMultipart !== undefined) {
+ def.mimeMultipart = CamelDefinitionApi.createMimeMultipartDataFormat(element.mimeMultipart);
+ }
+ if (element?.parquetAvro !== undefined) {
+ def.parquetAvro = CamelDefinitionApi.createParquetAvroDataFormat(element.parquetAvro);
+ }
+ if (element?.pgp !== undefined) {
+ def.pgp = CamelDefinitionApi.createPGPDataFormat(element.pgp);
+ }
+ if (element?.protobuf !== undefined) {
+ def.protobuf = CamelDefinitionApi.createProtobufDataFormat(element.protobuf);
+ }
+ if (element?.rss !== undefined) {
+ def.rss = CamelDefinitionApi.createRssDataFormat(element.rss);
+ }
+ if (element?.smooks !== undefined) {
+ def.smooks = CamelDefinitionApi.createSmooksDataFormat(element.smooks);
+ }
+ if (element?.soap !== undefined) {
+ def.soap = CamelDefinitionApi.createSoapDataFormat(element.soap);
+ }
+ if (element?.swiftMt !== undefined) {
+ def.swiftMt = CamelDefinitionApi.createSwiftMtDataFormat(element.swiftMt);
+ }
+ if (element?.swiftMx !== undefined) {
+ def.swiftMx = CamelDefinitionApi.createSwiftMxDataFormat(element.swiftMx);
+ }
+ if (element?.syslog !== undefined) {
+ def.syslog = CamelDefinitionApi.createSyslogDataFormat(element.syslog);
+ }
+ if (element?.tarFile !== undefined) {
+ def.tarFile = CamelDefinitionApi.createTarFileDataFormat(element.tarFile);
+ }
+ if (element?.thrift !== undefined) {
+ def.thrift = CamelDefinitionApi.createThriftDataFormat(element.thrift);
+ }
+ if (element?.tidyMarkup !== undefined) {
+ def.tidyMarkup = CamelDefinitionApi.createTidyMarkupDataFormat(element.tidyMarkup);
+ }
+ if (element?.univocityCsv !== undefined) {
+ def.univocityCsv = CamelDefinitionApi.createUniVocityCsvDataFormat(element.univocityCsv);
+ }
+ if (element?.univocityFixed !== undefined) {
+ def.univocityFixed = CamelDefinitionApi.createUniVocityFixedDataFormat(element.univocityFixed);
+ }
+ if (element?.univocityTsv !== undefined) {
+ def.univocityTsv = CamelDefinitionApi.createUniVocityTsvDataFormat(element.univocityTsv);
+ }
+ if (element?.xmlSecurity !== undefined) {
+ def.xmlSecurity = CamelDefinitionApi.createXMLSecurityDataFormat(element.xmlSecurity);
+ }
+ if (element?.yaml !== undefined) {
+ def.yaml = CamelDefinitionApi.createYAMLDataFormat(element.yaml);
+ }
+ if (element?.zipDeflater !== undefined) {
+ def.zipDeflater = CamelDefinitionApi.createZipDeflaterDataFormat(element.zipDeflater);
+ }
+ if (element?.zipFile !== undefined) {
+ def.zipFile = CamelDefinitionApi.createZipFileDataFormat(element.zipFile);
+ }
+ return def;
+ }
+
+ static createEndpointTransformerDefinition = (element: any): EndpointTransformerDefinition => {
+ const def = element ? new EndpointTransformerDefinition({...element}) : new EndpointTransformerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createLoadTransformerDefinition = (element: any): LoadTransformerDefinition => {
+ const def = element ? new LoadTransformerDefinition({...element}) : new LoadTransformerDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createTransformersDefinition = (element: any): TransformersDefinition => {
+ const def = element ? new TransformersDefinition({...element}) : new TransformersDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.customTransformer !== undefined) {
+ def.customTransformer = CamelDefinitionApi.createCustomTransformerDefinition(element.customTransformer);
+ }
+ if (element?.dataFormatTransformer !== undefined) {
+ def.dataFormatTransformer = CamelDefinitionApi.createDataFormatTransformerDefinition(element.dataFormatTransformer);
+ }
+ if (element?.endpointTransformer !== undefined) {
+ def.endpointTransformer = CamelDefinitionApi.createEndpointTransformerDefinition(element.endpointTransformer);
+ }
+ if (element?.loadTransformer !== undefined) {
+ def.loadTransformer = CamelDefinitionApi.createLoadTransformerDefinition(element.loadTransformer);
+ }
+ return def;
+ }
+
+ static createCustomValidatorDefinition = (element: any): CustomValidatorDefinition => {
+ const def = element ? new CustomValidatorDefinition({...element}) : new CustomValidatorDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createEndpointValidatorDefinition = (element: any): EndpointValidatorDefinition => {
+ const def = element ? new EndpointValidatorDefinition({...element}) : new EndpointValidatorDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ return def;
+ }
+
+ static createPredicateValidatorDefinition = (element: any): PredicateValidatorDefinition => {
+ const def = element ? new PredicateValidatorDefinition({...element}) : new PredicateValidatorDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ def.expression = CamelDefinitionApi.createExpressionDefinition(element.expression);
+
+ return def;
+ }
+
+ static createValidatorsDefinition = (element: any): ValidatorsDefinition => {
+ const def = element ? new ValidatorsDefinition({...element}) : new ValidatorsDefinition();
+ def.uuid = element?.uuid ? element.uuid : def.uuid;
+ if (element?.customValidator !== undefined) {
+ def.customValidator = CamelDefinitionApi.createCustomValidatorDefinition(element.customValidator);
+ }
+ if (element?.endpointValidator !== undefined) {
+ def.endpointValidator = CamelDefinitionApi.createEndpointValidatorDefinition(element.endpointValidator);
+ }
+ if (element?.predicateValidator !== undefined) {
+ def.predicateValidator = CamelDefinitionApi.createPredicateValidatorDefinition(element.predicateValidator);
+ }
+ return def;
+ }
+
+ static createStep = (name: string, body: any, clone: boolean = false): CamelElement => {
+ const newBody = CamelUtil.camelizeBody(name, body, clone);
+ switch (name) {
+ case 'ProcessorDefinition': return CamelDefinitionApi.createProcessorDefinition(newBody);
+ case 'BeansDeserializer': return CamelDefinitionApi.createBeansDeserializer(newBody);
+ case 'DataFormatsDefinitionDeserializer': return CamelDefinitionApi.createDataFormatsDefinitionDeserializer(newBody);
+ case 'ErrorHandlerDeserializer': return CamelDefinitionApi.createErrorHandlerDeserializer(newBody);
+ case 'OutputAwareFromDefinition': return CamelDefinitionApi.createOutputAwareFromDefinition(newBody);
+ case 'AggregateDefinition': return CamelDefinitionApi.createAggregateDefinition(newBody);
+ case 'BeanDefinition': return CamelDefinitionApi.createBeanDefinition(newBody);
+ case 'BeanFactoryDefinition': return CamelDefinitionApi.createBeanFactoryDefinition(newBody);
+ case 'CatchDefinition': return CamelDefinitionApi.createCatchDefinition(newBody);
+ case 'ChoiceDefinition': return CamelDefinitionApi.createChoiceDefinition(newBody);
+ case 'CircuitBreakerDefinition': return CamelDefinitionApi.createCircuitBreakerDefinition(newBody);
+ case 'ClaimCheckDefinition': return CamelDefinitionApi.createClaimCheckDefinition(newBody);
+ 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);
+ case 'EnrichDefinition': return CamelDefinitionApi.createEnrichDefinition(newBody);
+ case 'ErrorHandlerDefinition': return CamelDefinitionApi.createErrorHandlerDefinition(newBody);
+ case 'ExpressionSubElementDefinition': return CamelDefinitionApi.createExpressionSubElementDefinition(newBody);
+ case 'FaultToleranceConfigurationDefinition': return CamelDefinitionApi.createFaultToleranceConfigurationDefinition(newBody);
+ case 'FilterDefinition': return CamelDefinitionApi.createFilterDefinition(newBody);
+ case 'FinallyDefinition': return CamelDefinitionApi.createFinallyDefinition(newBody);
+ case 'FromDefinition': return CamelDefinitionApi.createFromDefinition(newBody);
+ case 'GlobalOptionDefinition': return CamelDefinitionApi.createGlobalOptionDefinition(newBody);
+ case 'GlobalOptionsDefinition': return CamelDefinitionApi.createGlobalOptionsDefinition(newBody);
+ case 'IdempotentConsumerDefinition': return CamelDefinitionApi.createIdempotentConsumerDefinition(newBody);
+ case 'InputTypeDefinition': return CamelDefinitionApi.createInputTypeDefinition(newBody);
+ case 'InterceptDefinition': return CamelDefinitionApi.createInterceptDefinition(newBody);
+ case 'InterceptFromDefinition': return CamelDefinitionApi.createInterceptFromDefinition(newBody);
+ case 'InterceptSendToEndpointDefinition': return CamelDefinitionApi.createInterceptSendToEndpointDefinition(newBody);
+ case 'KameletDefinition': return CamelDefinitionApi.createKameletDefinition(newBody);
+ case 'LoadBalanceDefinition': return CamelDefinitionApi.createLoadBalanceDefinition(newBody);
+ case 'LogDefinition': return CamelDefinitionApi.createLogDefinition(newBody);
+ case 'LoopDefinition': return CamelDefinitionApi.createLoopDefinition(newBody);
+ case 'MarshalDefinition': return CamelDefinitionApi.createMarshalDefinition(newBody);
+ case 'MulticastDefinition': return CamelDefinitionApi.createMulticastDefinition(newBody);
+ case 'OnCompletionDefinition': return CamelDefinitionApi.createOnCompletionDefinition(newBody);
+ case 'OnExceptionDefinition': return CamelDefinitionApi.createOnExceptionDefinition(newBody);
+ case 'OnFallbackDefinition': return CamelDefinitionApi.createOnFallbackDefinition(newBody);
+ case 'OnWhenDefinition': return CamelDefinitionApi.createOnWhenDefinition(newBody);
+ case 'OptimisticLockRetryPolicyDefinition': return CamelDefinitionApi.createOptimisticLockRetryPolicyDefinition(newBody);
+ case 'OtherwiseDefinition': return CamelDefinitionApi.createOtherwiseDefinition(newBody);
+ case 'OutputDefinition': return CamelDefinitionApi.createOutputDefinition(newBody);
+ case 'OutputTypeDefinition': return CamelDefinitionApi.createOutputTypeDefinition(newBody);
+ case 'PackageScanDefinition': return CamelDefinitionApi.createPackageScanDefinition(newBody);
+ case 'PausableDefinition': return CamelDefinitionApi.createPausableDefinition(newBody);
+ case 'PipelineDefinition': return CamelDefinitionApi.createPipelineDefinition(newBody);
+ case 'PolicyDefinition': return CamelDefinitionApi.createPolicyDefinition(newBody);
+ case 'PollDefinition': return CamelDefinitionApi.createPollDefinition(newBody);
+ case 'PollEnrichDefinition': return CamelDefinitionApi.createPollEnrichDefinition(newBody);
+ case 'ProcessDefinition': return CamelDefinitionApi.createProcessDefinition(newBody);
+ case 'PropertyDefinition': return CamelDefinitionApi.createPropertyDefinition(newBody);
+ case 'PropertyExpressionDefinition': return CamelDefinitionApi.createPropertyExpressionDefinition(newBody);
+ case 'RecipientListDefinition': return CamelDefinitionApi.createRecipientListDefinition(newBody);
+ case 'RedeliveryPolicyDefinition': return CamelDefinitionApi.createRedeliveryPolicyDefinition(newBody);
+ case 'RemoveHeaderDefinition': return CamelDefinitionApi.createRemoveHeaderDefinition(newBody);
+ 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);
+ case 'ResumableDefinition': return CamelDefinitionApi.createResumableDefinition(newBody);
+ case 'RollbackDefinition': return CamelDefinitionApi.createRollbackDefinition(newBody);
+ case 'RouteBuilderDefinition': return CamelDefinitionApi.createRouteBuilderDefinition(newBody);
+ case 'RouteConfigurationContextRefDefinition': return CamelDefinitionApi.createRouteConfigurationContextRefDefinition(newBody);
+ case 'RouteConfigurationDefinition': return CamelDefinitionApi.createRouteConfigurationDefinition(newBody);
+ case 'RouteContextRefDefinition': return CamelDefinitionApi.createRouteContextRefDefinition(newBody);
+ case 'RouteDefinition': return CamelDefinitionApi.createRouteDefinition(newBody);
+ case 'RouteTemplateDefinition': return CamelDefinitionApi.createRouteTemplateDefinition(newBody);
+ case 'RouteTemplateParameterDefinition': return CamelDefinitionApi.createRouteTemplateParameterDefinition(newBody);
+ case 'RoutingSlipDefinition': return CamelDefinitionApi.createRoutingSlipDefinition(newBody);
+ case 'SagaActionUriDefinition': return CamelDefinitionApi.createSagaActionUriDefinition(newBody);
+ case 'SagaDefinition': return CamelDefinitionApi.createSagaDefinition(newBody);
+ case 'SamplingDefinition': return CamelDefinitionApi.createSamplingDefinition(newBody);
+ case 'ScriptDefinition': return CamelDefinitionApi.createScriptDefinition(newBody);
+ case 'SetBodyDefinition': return CamelDefinitionApi.createSetBodyDefinition(newBody);
+ case 'SetExchangePatternDefinition': return CamelDefinitionApi.createSetExchangePatternDefinition(newBody);
+ 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 'SetVariablesDefinition': return CamelDefinitionApi.createSetVariablesDefinition(newBody);
+ case 'SortDefinition': return CamelDefinitionApi.createSortDefinition(newBody);
+ case 'SplitDefinition': return CamelDefinitionApi.createSplitDefinition(newBody);
+ case 'StepDefinition': return CamelDefinitionApi.createStepDefinition(newBody);
+ case 'StopDefinition': return CamelDefinitionApi.createStopDefinition(newBody);
+ case 'TemplatedRouteDefinition': return CamelDefinitionApi.createTemplatedRouteDefinition(newBody);
+ case 'TemplatedRouteParameterDefinition': return CamelDefinitionApi.createTemplatedRouteParameterDefinition(newBody);
+ case 'ThreadPoolProfileDefinition': return CamelDefinitionApi.createThreadPoolProfileDefinition(newBody);
+ case 'ThreadsDefinition': return CamelDefinitionApi.createThreadsDefinition(newBody);
+ case 'ThrottleDefinition': return CamelDefinitionApi.createThrottleDefinition(newBody);
+ case 'ThrowExceptionDefinition': return CamelDefinitionApi.createThrowExceptionDefinition(newBody);
+ case 'ToDefinition': return CamelDefinitionApi.createToDefinition(newBody);
+ case 'ToDynamicDefinition': return CamelDefinitionApi.createToDynamicDefinition(newBody);
+ case 'TokenizerDefinition': return CamelDefinitionApi.createTokenizerDefinition(newBody);
+ case 'TokenizerImplementationDefinition': return CamelDefinitionApi.createTokenizerImplementationDefinition(newBody);
+ case 'TransactedDefinition': return CamelDefinitionApi.createTransactedDefinition(newBody);
+ case 'TransformDefinition': return CamelDefinitionApi.createTransformDefinition(newBody);
+ case 'TryDefinition': return CamelDefinitionApi.createTryDefinition(newBody);
+ case 'UnmarshalDefinition': return CamelDefinitionApi.createUnmarshalDefinition(newBody);
+ case 'ValidateDefinition': return CamelDefinitionApi.createValidateDefinition(newBody);
+ case 'ValueDefinition': return CamelDefinitionApi.createValueDefinition(newBody);
+ case 'WhenDefinition': return CamelDefinitionApi.createWhenDefinition(newBody);
+ case 'WireTapDefinition': return CamelDefinitionApi.createWireTapDefinition(newBody);
+ case 'BeanConstructorDefinition': return CamelDefinitionApi.createBeanConstructorDefinition(newBody);
+ case 'BeanConstructorsDefinition': return CamelDefinitionApi.createBeanConstructorsDefinition(newBody);
+ case 'BeanPropertiesDefinition': return CamelDefinitionApi.createBeanPropertiesDefinition(newBody);
+ case 'BeanPropertyDefinition': return CamelDefinitionApi.createBeanPropertyDefinition(newBody);
+ case 'ComponentScanDefinition': return CamelDefinitionApi.createComponentScanDefinition(newBody);
+ case 'BatchResequencerConfig': return CamelDefinitionApi.createBatchResequencerConfig(newBody);
+ case 'StreamResequencerConfig': return CamelDefinitionApi.createStreamResequencerConfig(newBody);
+ case 'ASN1DataFormat': return CamelDefinitionApi.createASN1DataFormat(newBody);
+ 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);
+ case 'CsvDataFormat': return CamelDefinitionApi.createCsvDataFormat(newBody);
+ case 'CustomDataFormat': return CamelDefinitionApi.createCustomDataFormat(newBody);
+ case 'DataFormatsDefinition': return CamelDefinitionApi.createDataFormatsDefinition(newBody);
+ case 'DfdlDataFormat': return CamelDefinitionApi.createDfdlDataFormat(newBody);
+ case 'FhirJsonDataFormat': return CamelDefinitionApi.createFhirJsonDataFormat(newBody);
+ case 'FhirXmlDataFormat': return CamelDefinitionApi.createFhirXmlDataFormat(newBody);
+ case 'FlatpackDataFormat': return CamelDefinitionApi.createFlatpackDataFormat(newBody);
+ case 'ForyDataFormat': return CamelDefinitionApi.createForyDataFormat(newBody);
+ case 'GrokDataFormat': return CamelDefinitionApi.createGrokDataFormat(newBody);
+ case 'GzipDeflaterDataFormat': return CamelDefinitionApi.createGzipDeflaterDataFormat(newBody);
+ case 'HL7DataFormat': return CamelDefinitionApi.createHL7DataFormat(newBody);
+ case 'IcalDataFormat': return CamelDefinitionApi.createIcalDataFormat(newBody);
+ case 'Iso8583DataFormat': return CamelDefinitionApi.createIso8583DataFormat(newBody);
+ case 'JacksonXMLDataFormat': return CamelDefinitionApi.createJacksonXMLDataFormat(newBody);
+ case 'JaxbDataFormat': return CamelDefinitionApi.createJaxbDataFormat(newBody);
+ case 'JsonApiDataFormat': return CamelDefinitionApi.createJsonApiDataFormat(newBody);
+ case 'JsonDataFormat': return CamelDefinitionApi.createJsonDataFormat(newBody);
+ case 'LZFDataFormat': return CamelDefinitionApi.createLZFDataFormat(newBody);
+ case 'MimeMultipartDataFormat': return CamelDefinitionApi.createMimeMultipartDataFormat(newBody);
+ case 'PGPDataFormat': return CamelDefinitionApi.createPGPDataFormat(newBody);
+ case 'ParquetAvroDataFormat': return CamelDefinitionApi.createParquetAvroDataFormat(newBody);
+ case 'ProtobufDataFormat': return CamelDefinitionApi.createProtobufDataFormat(newBody);
+ case 'RssDataFormat': return CamelDefinitionApi.createRssDataFormat(newBody);
+ case 'SmooksDataFormat': return CamelDefinitionApi.createSmooksDataFormat(newBody);
+ case 'SoapDataFormat': return CamelDefinitionApi.createSoapDataFormat(newBody);
+ case 'SwiftMtDataFormat': return CamelDefinitionApi.createSwiftMtDataFormat(newBody);
+ case 'SwiftMxDataFormat': return CamelDefinitionApi.createSwiftMxDataFormat(newBody);
+ case 'SyslogDataFormat': return CamelDefinitionApi.createSyslogDataFormat(newBody);
+ case 'TarFileDataFormat': return CamelDefinitionApi.createTarFileDataFormat(newBody);
+ case 'ThriftDataFormat': return CamelDefinitionApi.createThriftDataFormat(newBody);
+ case 'TidyMarkupDataFormat': return CamelDefinitionApi.createTidyMarkupDataFormat(newBody);
+ case 'UniVocityCsvDataFormat': return CamelDefinitionApi.createUniVocityCsvDataFormat(newBody);
+ case 'UniVocityFixedDataFormat': return CamelDefinitionApi.createUniVocityFixedDataFormat(newBody);
+ case 'UniVocityHeader': return CamelDefinitionApi.createUniVocityHeader(newBody);
+ case 'UniVocityTsvDataFormat': return CamelDefinitionApi.createUniVocityTsvDataFormat(newBody);
+ case 'XMLSecurityDataFormat': return CamelDefinitionApi.createXMLSecurityDataFormat(newBody);
+ case 'YAMLDataFormat': return CamelDefinitionApi.createYAMLDataFormat(newBody);
+ case 'YAMLTypeFilterDefinition': return CamelDefinitionApi.createYAMLTypeFilterDefinition(newBody);
+ case 'ZipDeflaterDataFormat': return CamelDefinitionApi.createZipDeflaterDataFormat(newBody);
+ case 'ZipFileDataFormat': return CamelDefinitionApi.createZipFileDataFormat(newBody);
+ case 'DeadLetterChannelDefinition': return CamelDefinitionApi.createDeadLetterChannelDefinition(newBody);
+ case 'DefaultErrorHandlerDefinition': return CamelDefinitionApi.createDefaultErrorHandlerDefinition(newBody);
+ case 'JtaTransactionErrorHandlerDefinition': return CamelDefinitionApi.createJtaTransactionErrorHandlerDefinition(newBody);
+ case 'NoErrorHandlerDefinition': return CamelDefinitionApi.createNoErrorHandlerDefinition(newBody);
+ case 'RefErrorHandlerDefinition': return CamelDefinitionApi.createRefErrorHandlerDefinition(newBody);
+ case 'SpringTransactionErrorHandlerDefinition': return CamelDefinitionApi.createSpringTransactionErrorHandlerDefinition(newBody);
+ case 'CSimpleExpression': return CamelDefinitionApi.createCSimpleExpression(newBody);
+ case 'ConstantExpression': return CamelDefinitionApi.createConstantExpression(newBody);
+ case 'DatasonnetExpression': return CamelDefinitionApi.createDatasonnetExpression(newBody);
+ case 'ExchangePropertyExpression': return CamelDefinitionApi.createExchangePropertyExpression(newBody);
+ case 'ExpressionDefinition': return CamelDefinitionApi.createExpressionDefinition(newBody);
+ case 'GroovyExpression': return CamelDefinitionApi.createGroovyExpression(newBody);
+ case 'HeaderExpression': return CamelDefinitionApi.createHeaderExpression(newBody);
+ case 'Hl7TerserExpression': return CamelDefinitionApi.createHl7TerserExpression(newBody);
+ case 'JavaExpression': return CamelDefinitionApi.createJavaExpression(newBody);
+ case 'JavaScriptExpression': return CamelDefinitionApi.createJavaScriptExpression(newBody);
+ case 'JqExpression': return CamelDefinitionApi.createJqExpression(newBody);
+ case 'JsonPathExpression': return CamelDefinitionApi.createJsonPathExpression(newBody);
+ case 'LanguageExpression': return CamelDefinitionApi.createLanguageExpression(newBody);
+ case 'MethodCallExpression': return CamelDefinitionApi.createMethodCallExpression(newBody);
+ case 'MvelExpression': return CamelDefinitionApi.createMvelExpression(newBody);
+ case 'PythonExpression': return CamelDefinitionApi.createPythonExpression(newBody);
+ case 'RefExpression': return CamelDefinitionApi.createRefExpression(newBody);
+ 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);
+ case 'CustomLoadBalancerDefinition': return CamelDefinitionApi.createCustomLoadBalancerDefinition(newBody);
+ case 'FailoverLoadBalancerDefinition': return CamelDefinitionApi.createFailoverLoadBalancerDefinition(newBody);
+ case 'RandomLoadBalancerDefinition': return CamelDefinitionApi.createRandomLoadBalancerDefinition(newBody);
+ case 'RoundRobinLoadBalancerDefinition': return CamelDefinitionApi.createRoundRobinLoadBalancerDefinition(newBody);
+ case 'StickyLoadBalancerDefinition': return CamelDefinitionApi.createStickyLoadBalancerDefinition(newBody);
+ case 'TopicLoadBalancerDefinition': return CamelDefinitionApi.createTopicLoadBalancerDefinition(newBody);
+ case 'WeightedLoadBalancerDefinition': return CamelDefinitionApi.createWeightedLoadBalancerDefinition(newBody);
+ case 'ApiKeyDefinition': return CamelDefinitionApi.createApiKeyDefinition(newBody);
+ case 'BasicAuthDefinition': return CamelDefinitionApi.createBasicAuthDefinition(newBody);
+ case 'BearerTokenDefinition': return CamelDefinitionApi.createBearerTokenDefinition(newBody);
+ case 'DeleteDefinition': return CamelDefinitionApi.createDeleteDefinition(newBody);
+ case 'GetDefinition': return CamelDefinitionApi.createGetDefinition(newBody);
+ case 'HeadDefinition': return CamelDefinitionApi.createHeadDefinition(newBody);
+ case 'MutualTLSDefinition': return CamelDefinitionApi.createMutualTLSDefinition(newBody);
+ case 'OAuth2Definition': return CamelDefinitionApi.createOAuth2Definition(newBody);
+ case 'OpenApiDefinition': return CamelDefinitionApi.createOpenApiDefinition(newBody);
+ case 'OpenIdConnectDefinition': return CamelDefinitionApi.createOpenIdConnectDefinition(newBody);
+ case 'ParamDefinition': return CamelDefinitionApi.createParamDefinition(newBody);
+ case 'PatchDefinition': return CamelDefinitionApi.createPatchDefinition(newBody);
+ case 'PostDefinition': return CamelDefinitionApi.createPostDefinition(newBody);
+ case 'PutDefinition': return CamelDefinitionApi.createPutDefinition(newBody);
+ case 'ResponseHeaderDefinition': return CamelDefinitionApi.createResponseHeaderDefinition(newBody);
+ case 'ResponseMessageDefinition': return CamelDefinitionApi.createResponseMessageDefinition(newBody);
+ case 'RestBindingDefinition': return CamelDefinitionApi.createRestBindingDefinition(newBody);
+ case 'RestConfigurationDefinition': return CamelDefinitionApi.createRestConfigurationDefinition(newBody);
+ case 'RestDefinition': return CamelDefinitionApi.createRestDefinition(newBody);
+ case 'RestPropertyDefinition': return CamelDefinitionApi.createRestPropertyDefinition(newBody);
+ case 'RestSecuritiesDefinition': return CamelDefinitionApi.createRestSecuritiesDefinition(newBody);
+ case 'RestsDefinition': return CamelDefinitionApi.createRestsDefinition(newBody);
+ case 'SecurityDefinition': return CamelDefinitionApi.createSecurityDefinition(newBody);
+ case 'LangChain4jCharacterTokenizerDefinition': return CamelDefinitionApi.createLangChain4jCharacterTokenizerDefinition(newBody);
+ case 'LangChain4jLineTokenizerDefinition': return CamelDefinitionApi.createLangChain4jLineTokenizerDefinition(newBody);
+ case 'LangChain4jParagraphTokenizerDefinition': return CamelDefinitionApi.createLangChain4jParagraphTokenizerDefinition(newBody);
+ case 'LangChain4jSentenceTokenizerDefinition': return CamelDefinitionApi.createLangChain4jSentenceTokenizerDefinition(newBody);
+ case 'LangChain4jTokenizerDefinition': return CamelDefinitionApi.createLangChain4jTokenizerDefinition(newBody);
+ case 'LangChain4jWordTokenizerDefinition': return CamelDefinitionApi.createLangChain4jWordTokenizerDefinition(newBody);
+ case 'CustomTransformerDefinition': return CamelDefinitionApi.createCustomTransformerDefinition(newBody);
+ case 'DataFormatTransformerDefinition': return CamelDefinitionApi.createDataFormatTransformerDefinition(newBody);
+ case 'EndpointTransformerDefinition': return CamelDefinitionApi.createEndpointTransformerDefinition(newBody);
+ case 'LoadTransformerDefinition': return CamelDefinitionApi.createLoadTransformerDefinition(newBody);
+ case 'TransformersDefinition': return CamelDefinitionApi.createTransformersDefinition(newBody);
+ case 'CustomValidatorDefinition': return CamelDefinitionApi.createCustomValidatorDefinition(newBody);
+ case 'EndpointValidatorDefinition': return CamelDefinitionApi.createEndpointValidatorDefinition(newBody);
+ case 'PredicateValidatorDefinition': return CamelDefinitionApi.createPredicateValidatorDefinition(newBody);
+ case 'ValidatorsDefinition': return CamelDefinitionApi.createValidatorsDefinition(newBody);
+ default: return new CamelElement('');
+ }
+ }
+
+ static createExpression = (name: string, body: any): CamelElement => {
+ const newBody = CamelUtil.camelizeBody(name, body, false);
+ delete newBody.expressionName;
+ delete newBody.dslName;
+ switch (name) {
+ case 'ConstantExpression': return CamelDefinitionApi.createConstantExpression(newBody);
+ case 'CSimpleExpression': return CamelDefinitionApi.createCSimpleExpression(newBody);
+ case 'DatasonnetExpression': return CamelDefinitionApi.createDatasonnetExpression(newBody);
+ case 'ExchangePropertyExpression': return CamelDefinitionApi.createExchangePropertyExpression(newBody);
+ case 'GroovyExpression': return CamelDefinitionApi.createGroovyExpression(newBody);
+ case 'HeaderExpression': return CamelDefinitionApi.createHeaderExpression(newBody);
+ case 'Hl7TerserExpression': return CamelDefinitionApi.createHl7TerserExpression(newBody);
+ case 'JavaExpression': return CamelDefinitionApi.createJavaExpression(newBody);
+ case 'JqExpression': return CamelDefinitionApi.createJqExpression(newBody);
+ case 'JavaScriptExpression': return CamelDefinitionApi.createJavaScriptExpression(newBody);
+ case 'JsonPathExpression': return CamelDefinitionApi.createJsonPathExpression(newBody);
+ case 'LanguageExpression': return CamelDefinitionApi.createLanguageExpression(newBody);
+ case 'MethodCallExpression': return CamelDefinitionApi.createMethodCallExpression(newBody);
+ case 'MvelExpression': return CamelDefinitionApi.createMvelExpression(newBody);
+ case 'PythonExpression': return CamelDefinitionApi.createPythonExpression(newBody);
+ case 'RefExpression': return CamelDefinitionApi.createRefExpression(newBody);
+ 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);
+ default: return new GroovyExpression(newBody);
+ }
+ }
+
+ static createDataFormat = (name: string, body: any): CamelElement => {
+ const newBody = CamelUtil.camelizeBody(name, body, false);
+ delete newBody.dataFormatName;
+ delete newBody.dslName;
+ switch (name) {
+ case 'ASN1DataFormat': return CamelDefinitionApi.createASN1DataFormat(newBody);
+ 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);
+ case 'CsvDataFormat': return CamelDefinitionApi.createCsvDataFormat(newBody);
+ case 'CustomDataFormat': return CamelDefinitionApi.createCustomDataFormat(newBody);
+ case 'DfdlDataFormat': return CamelDefinitionApi.createDfdlDataFormat(newBody);
+ case 'FhirJsonDataFormat': return CamelDefinitionApi.createFhirJsonDataFormat(newBody);
+ case 'FhirXmlDataFormat': return CamelDefinitionApi.createFhirXmlDataFormat(newBody);
+ case 'FlatpackDataFormat': return CamelDefinitionApi.createFlatpackDataFormat(newBody);
+ case 'ForyDataFormat': return CamelDefinitionApi.createForyDataFormat(newBody);
+ case 'GrokDataFormat': return CamelDefinitionApi.createGrokDataFormat(newBody);
+ case 'GzipDeflaterDataFormat': return CamelDefinitionApi.createGzipDeflaterDataFormat(newBody);
+ case 'HL7DataFormat': return CamelDefinitionApi.createHL7DataFormat(newBody);
+ case 'IcalDataFormat': return CamelDefinitionApi.createIcalDataFormat(newBody);
+ case 'Iso8583DataFormat': return CamelDefinitionApi.createIso8583DataFormat(newBody);
+ case 'JacksonXMLDataFormat': return CamelDefinitionApi.createJacksonXMLDataFormat(newBody);
+ case 'JaxbDataFormat': return CamelDefinitionApi.createJaxbDataFormat(newBody);
+ case 'JsonDataFormat': return CamelDefinitionApi.createJsonDataFormat(newBody);
+ case 'JsonApiDataFormat': return CamelDefinitionApi.createJsonApiDataFormat(newBody);
+ case 'LZFDataFormat': return CamelDefinitionApi.createLZFDataFormat(newBody);
+ case 'MimeMultipartDataFormat': return CamelDefinitionApi.createMimeMultipartDataFormat(newBody);
+ case 'ParquetAvroDataFormat': return CamelDefinitionApi.createParquetAvroDataFormat(newBody);
+ case 'PGPDataFormat': return CamelDefinitionApi.createPGPDataFormat(newBody);
+ case 'ProtobufDataFormat': return CamelDefinitionApi.createProtobufDataFormat(newBody);
+ case 'RssDataFormat': return CamelDefinitionApi.createRssDataFormat(newBody);
+ case 'SmooksDataFormat': return CamelDefinitionApi.createSmooksDataFormat(newBody);
+ case 'SoapDataFormat': return CamelDefinitionApi.createSoapDataFormat(newBody);
+ case 'SwiftMtDataFormat': return CamelDefinitionApi.createSwiftMtDataFormat(newBody);
+ case 'SwiftMxDataFormat': return CamelDefinitionApi.createSwiftMxDataFormat(newBody);
+ case 'SyslogDataFormat': return CamelDefinitionApi.createSyslogDataFormat(newBody);
+ case 'TarFileDataFormat': return CamelDefinitionApi.createTarFileDataFormat(newBody);
+ case 'ThriftDataFormat': return CamelDefinitionApi.createThriftDataFormat(newBody);
+ case 'TidyMarkupDataFormat': return CamelDefinitionApi.createTidyMarkupDataFormat(newBody);
+ case 'UniVocityCsvDataFormat': return CamelDefinitionApi.createUniVocityCsvDataFormat(newBody);
+ case 'UniVocityFixedDataFormat': return CamelDefinitionApi.createUniVocityFixedDataFormat(newBody);
+ case 'UniVocityTsvDataFormat': return CamelDefinitionApi.createUniVocityTsvDataFormat(newBody);
+ case 'XMLSecurityDataFormat': return CamelDefinitionApi.createXMLSecurityDataFormat(newBody);
+ case 'YAMLDataFormat': return CamelDefinitionApi.createYAMLDataFormat(newBody);
+ case 'ZipDeflaterDataFormat': return CamelDefinitionApi.createZipDeflaterDataFormat(newBody);
+ case 'ZipFileDataFormat': return CamelDefinitionApi.createZipFileDataFormat(newBody);
+ default: return new JsonDataFormat(newBody);
+ }
+ }
+
+ static createSteps = (elements: any[] | undefined): CamelElement[] => {
+ const result: CamelElement[] = []
+ if (elements !== undefined){
+ elements.forEach(e => {
+ result.push(CamelDefinitionApi.createStep(e.dslName, e));
+ })
+ }
+ return result
+ }
+}
diff --git a/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionApiExt.ts b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionApiExt.ts
new file mode 100644
index 00000000..f8dbfa27
--- /dev/null
+++ b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionApiExt.ts
@@ -0,0 +1,865 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import { CamelMetadataApi, ElementMeta, Languages, PropertyMeta } from '../model/CamelMetadata';
+import { CamelUtil } from './CamelUtil';
+import {
+ BeanFactoryDefinition,
+ ExpressionDefinition,
+ RouteDefinition,
+ RestDefinition,
+ RouteConfigurationDefinition, FromDefinition, RouteTemplateDefinition,
+} from '../model/CamelDefinition';
+import { Beans, CamelElement, CamelElementMeta, Integration } from '../model/IntegrationDefinition';
+import { CamelDefinitionApi } from './CamelDefinitionApi';
+
+const coreRoutishElements = ['RouteConfigurationDefinition', 'RouteTemplateDefinition', 'RouteDefinition']
+
+export class ChildElement {
+ constructor(public name: string = '', public className: string = '', public multiple: boolean = false) {}
+}
+
+export class CamelDefinitionApiExt {
+ private constructor() {}
+
+ // additional helper functions for more readability
+ static getFlowsOfType(integration: Integration, type: string): CamelElement[] {
+ return integration.spec.flows?.filter(flow => flow.dslName === type) ?? [];
+ }
+
+ static getFlowsOfTypes(integration: Integration, types: string[]): CamelElement[] {
+ return integration.spec.flows?.filter(flow => types.includes(flow.dslName)) ?? [];
+ }
+
+ static getFlowsNotOfTypes(integration: Integration, types: string[]): any[] {
+ return integration.spec.flows?.filter(flow => !types.includes(flow.dslName)) ?? [];
+ }
+
+ static replaceFromInIntegration = (integration: Integration, fromId: string, newFrom: FromDefinition): Integration => {
+ const flows: any = [];
+ CamelDefinitionApiExt.getFlowsNotOfTypes(integration, ['RouteDefinition', 'RouteTemplateDefinition']).forEach(notRoutes =>
+ flows.push(notRoutes),
+ );
+ CamelDefinitionApiExt.getFlowsOfTypes(integration, ['RouteDefinition', 'RouteTemplateDefinition']).map(r => {
+ if (r.dslName === 'RouteDefinition') {
+ const route = (r as RouteDefinition);
+ if (route.from.id === fromId) {
+ newFrom.steps = [...route.from.steps];
+ route.from = newFrom;
+ flows.push(route);
+ } else {
+ flows.push(route);
+ }
+ } else if (r.dslName === 'RouteTemplateDefinition') {
+ const routeTemplate = (r as RouteTemplateDefinition);
+ if (routeTemplate.route?.from.id === fromId) {
+ newFrom.steps = [...routeTemplate.route?.from.steps];
+ routeTemplate.route.from = newFrom;
+ flows.push(routeTemplate);
+ } else {
+ flows.push(routeTemplate);
+ }
+ }
+
+ })
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static addStepToIntegration = (integration: Integration, step: CamelElement, parentId: string, position?: number,): Integration => {
+ if (step.dslName === 'RouteDefinition') {
+ integration.spec.flows?.push(step as RouteDefinition);
+ } else {
+ const flows: any = [];
+ CamelDefinitionApiExt.getFlowsNotOfTypes(integration, coreRoutishElements).forEach(bean =>
+ flows.push(bean),
+ );
+ const routes = CamelDefinitionApiExt.addStepToSteps(CamelDefinitionApiExt.getFlowsOfType(integration, 'RouteDefinition'), step, parentId, position,);
+ flows.push(...routes);
+ const routeConfigurations = CamelDefinitionApiExt.addStepToSteps(CamelDefinitionApiExt.getFlowsOfType(integration, 'RouteConfigurationDefinition'),step, parentId, position,);
+ flows.push(...routeConfigurations);
+ const routeTemplates = CamelDefinitionApiExt.addStepToSteps(CamelDefinitionApiExt.getFlowsOfType(integration, 'RouteTemplateDefinition'),step, parentId, position,);
+ flows.push(...routeTemplates);
+ integration.spec.flows = flows;
+ }
+ return integration;
+ };
+
+ static addStepToStep = (step: CamelElement, stepAdded: CamelElement, parentId: string, position: number = -1,): CamelElement => {
+ const result = CamelUtil.cloneStep(step);
+ const children = CamelDefinitionApiExt.getElementChildrenDefinition(result.dslName);
+ let added = false;
+
+ // Check all fields except steps
+ for (const child of children.filter(child => child.name !== 'steps') ?? []) {
+ if (result.uuid === parentId) {
+ if (child.className === stepAdded.dslName) {
+ added = true;
+ if (child.multiple) {
+ (result as any)[child.name].push(stepAdded);
+ } else {
+ (result as any)[child.name] = stepAdded;
+ }
+ }
+ } else {
+ const fieldValue = (result as any)[child.name];
+ if (child.multiple) {
+ (result as any)[child.name] = CamelDefinitionApiExt.addStepToSteps((result as any)[child.name], stepAdded, parentId, position,);
+ } else if (fieldValue) {
+ (result as any)[child.name] = CamelDefinitionApiExt.addStepToStep(fieldValue, stepAdded, parentId, position);
+ }
+ }
+ }
+
+ // Then steps
+ const steps = children.filter(child => child.name === 'steps');
+ if (!added && steps && result.uuid === parentId) {
+ if (position > -1) {
+ (result as any).steps.splice(position, 0, stepAdded);
+ } else {
+ (result as any).steps.push(stepAdded);
+ }
+ } else if (!added && steps && (result as any).steps) {
+ (result as any).steps = CamelDefinitionApiExt.addStepToSteps((result as any).steps, stepAdded, parentId, position);
+ }
+
+ return result;
+ };
+
+ static addStepToSteps = (steps: CamelElement[], step: CamelElement, parentId: string, position?: number,): CamelElement[] => {
+ const result: CamelElement[] = [];
+ for (const element of steps) {
+ const newStep = CamelDefinitionApiExt.addStepToStep(element, step, parentId, position);
+ result.push(newStep);
+ }
+ return result;
+ };
+
+ static findElementInIntegration = (integration: Integration, uuid: string): CamelElement | undefined => {
+ return CamelDefinitionApiExt.findElementMetaInIntegration(integration, uuid)?.step;
+ };
+
+ static findElementMetaInIntegration = (integration: Integration, uuid: string): CamelElementMeta => {
+ const i = CamelUtil.cloneIntegration(integration);
+ const routes = i.spec.flows?.filter(flow => coreRoutishElements.includes(flow.dslName),);
+ return CamelDefinitionApiExt.findElementInElements(routes, uuid);
+ };
+
+ static findElementPathUuids = (integration: Integration, uuid: string): string[] => {
+ const result: string[] = [];
+ let meta = CamelDefinitionApiExt.findElementMetaInIntegration(integration, uuid);
+ if (meta && meta.parentUuid) {
+ while (meta.step?.dslName !== 'FromDefinition') {
+ if (meta.parentUuid) {
+ result.push(meta.parentUuid);
+ meta = CamelDefinitionApiExt.findElementMetaInIntegration(integration, meta.parentUuid);
+ } else {
+ break;
+ }
+ }
+ }
+ return result;
+ };
+
+ static findTopRouteElement = (integration: Integration, uuid: string): CamelElement | undefined => {
+ const result: string[] = [];
+ let meta = CamelDefinitionApiExt.findElementMetaInIntegration(integration, uuid);
+ if (meta) {
+ while (meta.parentUuid !== undefined) {
+ if (meta.parentUuid) {
+ result.push(meta.parentUuid);
+ meta = CamelDefinitionApiExt.findElementMetaInIntegration(integration, meta.parentUuid);
+ } else {
+ break;
+ }
+ }
+ }
+ const last = result.at(-1);
+ return last ? CamelDefinitionApiExt.findElementInIntegration(integration, last): undefined
+ };
+
+ static findElementInElements = (steps: CamelElement[] | undefined, uuid: string, result: CamelElementMeta = new CamelElementMeta(undefined, undefined, undefined),
+ parentUuid?: string,): CamelElementMeta => {
+ if (result?.step !== undefined) {
+ return result;
+ }
+
+ if (steps !== undefined) {
+ for (let index = 0, step: CamelElement; (step = steps[index]); index++) {
+ if (step.uuid === uuid) {
+ result = new CamelElementMeta(step, parentUuid, index);
+ break;
+ } else {
+ const ce = CamelDefinitionApiExt.getElementChildrenDefinition(step.dslName);
+ for (const e of ce) {
+ const cel = CamelDefinitionApiExt.getElementChildren(step, e);
+ if (e.multiple) {
+ result = CamelDefinitionApiExt.findElementInElements(cel, uuid, result, step.uuid);
+ } else {
+ const prop = (step as any)[e.name];
+ if (prop && prop.hasOwnProperty('uuid')) {
+ result = CamelDefinitionApiExt.findElementInElements([prop], uuid, result, step.uuid);
+ }
+ }
+ }
+ }
+ }
+ }
+ return new CamelElementMeta(result?.step, result?.parentUuid, result?.position);
+ };
+
+ static hasElementWithId = (integration: Integration, id: string): number => {
+ return CamelDefinitionApiExt.checkIfHasId(integration, id, 0);
+ };
+
+ static checkIfHasId = (obj: Object, id: string, counter: number): number => {
+ for (const propName in obj) {
+ let prop = (obj as any)[propName];
+ if (propName === 'id' && id === prop) {
+ counter++;
+ counter = CamelDefinitionApiExt.checkIfHasId(prop, id, counter);
+ } else if (typeof prop === 'object' && prop !== null) {
+ counter = CamelDefinitionApiExt.checkIfHasId(prop, id, counter);
+ } else if (Array.isArray(prop)) {
+ for (const element of prop) {
+ CamelDefinitionApiExt.checkIfHasId(element, id, counter);
+ }
+ }
+ }
+ return counter;
+ };
+
+ static findElementById = (integration: Integration, id: string): CamelElement | undefined => {
+ return CamelDefinitionApiExt.findElementsById(integration, id, [])?.at(0);
+ };
+
+ static findElementsById = (obj: Object, id: string, elements: CamelElement[]): CamelElement[] => {
+ for (const propName in obj) {
+ let prop = (obj as any)[propName];
+ if (propName === 'id' && id === prop) {
+ elements.push(obj as CamelElement)
+ elements = CamelDefinitionApiExt.findElementsById(prop, id, elements);
+ } else if (typeof prop === 'object' && prop !== null) {
+ elements = CamelDefinitionApiExt.findElementsById(prop, id, elements);
+ } else if (Array.isArray(prop)) {
+ for (const element of prop) {
+ elements = CamelDefinitionApiExt.findElementsById(element, id, elements);
+ }
+ }
+ }
+ return elements;
+ };
+
+ static moveRouteElement = (integration: Integration, source: string, target: string, asChild: boolean,): Integration => {
+ const sourceFindStep = CamelDefinitionApiExt.findElementMetaInIntegration(integration, source);
+ const sourceStep = sourceFindStep.step;
+ const sourceUuid = sourceStep?.uuid;
+ const targetFindStep = CamelDefinitionApiExt.findElementMetaInIntegration(integration, target);
+ const parentUuid = targetFindStep.parentUuid;
+ if (sourceUuid && parentUuid && sourceStep && !CamelDefinitionApiExt.findElementPathUuids(integration, target).includes(source)) {
+ CamelDefinitionApiExt.deleteStepFromIntegration(integration, sourceUuid);
+ if (asChild) {
+ return CamelDefinitionApiExt.addStepToIntegration(
+ integration,
+ sourceStep,
+ target,
+ (targetFindStep?.step as any)?.steps?.length,
+ );
+ } else {
+ switch (targetFindStep.step?.dslName) {
+ case 'when':
+ return CamelDefinitionApiExt.addStepToIntegration(integration, sourceStep, targetFindStep.step?.uuid, undefined);
+ case 'otherwise':
+ return CamelDefinitionApiExt.addStepToIntegration(integration, sourceStep, targetFindStep.step?.uuid, undefined);
+ default:
+ return CamelDefinitionApiExt.addStepToIntegration(integration, sourceStep, parentUuid, targetFindStep.position);
+ }
+ }
+ }
+ return integration;
+ };
+
+ static deleteStepFromIntegration = (integration: Integration, uuidToDelete: string): Integration => {
+ const flows: any[] =
+ integration.spec.flows?.filter(flow => !coreRoutishElements.includes(flow.dslName),) ?? [];
+ const routes = CamelDefinitionApiExt.deleteStepFromSteps(
+ integration.spec.flows?.filter(flow => coreRoutishElements.includes(flow.dslName),),
+ uuidToDelete,
+ );
+ flows.push(...routes);
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static deleteStepFromStep = (step: CamelElement, uuidToDelete: string): CamelElement => {
+ const result = CamelDefinitionApi.createStep(step.dslName, step);
+ const ce = CamelDefinitionApiExt.getElementChildrenDefinition(step.dslName);
+ for (const e of ce) {
+ const cel = CamelDefinitionApiExt.getElementChildren(step, e);
+ if (e.multiple) {
+ (result as any)[e.name] = CamelDefinitionApiExt.deleteStepFromSteps((result as any)[e.name], uuidToDelete);
+ } else {
+ const prop = (result as any)[e.name];
+ if (prop?.hasOwnProperty('uuid')) {
+ if (prop.uuid === uuidToDelete) {
+ delete (result as any)[e.name];
+ } else {
+ (result as any)[e.name] = CamelDefinitionApiExt.deleteStepFromStep(cel[0], uuidToDelete);
+ }
+ }
+ }
+ }
+ return result;
+ };
+
+ static deleteStepFromSteps = (steps: CamelElement[] | undefined, uuidToDelete: string): CamelElement[] => {
+ const result: CamelElement[] = [];
+ if (steps !== undefined) {
+ for (const step of steps) {
+ if (step.uuid !== uuidToDelete) {
+ const newStep = CamelDefinitionApiExt.deleteStepFromStep(step, uuidToDelete);
+ result.push(newStep);
+ }
+ }
+ }
+ return result;
+ };
+
+ static addBeanToIntegration = (integration: Integration, bean: BeanFactoryDefinition): Integration => {
+ const flows: any[] = [];
+ const beans: Beans[] = integration.spec.flows?.filter(flow => flow.dslName === 'Beans') ?? [];
+ if (integration.spec.flows && beans.length === 0) {
+ flows.push(...integration.spec.flows);
+ flows.push(new Beans({ beans: [bean] }));
+ } else {
+ flows.push(...integration.spec.flows?.filter(flow => flow.dslName !== 'Beans') ?? []);
+ for (const flow of beans) {
+ const beans: BeanFactoryDefinition[] = [];
+ if ((flow as Beans).beans.filter(b => b.uuid === bean.uuid).length === 0) {
+ beans.push(...(flow as Beans).beans.filter(b => b.uuid !== bean.uuid));
+ beans.push(bean);
+ } else {
+ for (const b of (flow as Beans).beans) {
+ if (b.uuid === bean.uuid) beans.push(bean);
+ else beans.push(b);
+ }
+ }
+ const newBeans = new Beans({ beans: beans });
+ flows.push(newBeans);
+ }
+ }
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static deleteBeanFromIntegration = (integration: Integration, bean?: BeanFactoryDefinition): Integration => {
+ const flows: any[] = [];
+ for (const flow of integration.spec.flows ?? []) {
+ if (flow.dslName === 'Beans') {
+ const beans: BeanFactoryDefinition[] = (flow as Beans).beans.filter(
+ b => !(b.uuid === bean?.uuid && b.type === bean?.type),
+ );
+ if (beans.length > 0) {
+ const newBeans = new Beans({ beans: beans });
+ flows.push(newBeans);
+ }
+ } else {
+ flows.push(flow);
+ }
+ }
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static addRouteConfigurationToIntegration = (
+ integration: Integration,
+ routeConfiguration: RouteConfigurationDefinition,
+ ): Integration => {
+ integration.spec.flows?.push(routeConfiguration);
+ return integration;
+ };
+
+ static deleteRouteConfigurationFromIntegration = (
+ integration: Integration,
+ routeConfiguration: RouteConfigurationDefinition,
+ ): Integration => {
+ const newFlows: any[] = [];
+ const flows: any[] = integration.spec.flows ?? [];
+ newFlows.push(...flows.filter(flow => flow.dslName !== 'RouteConfigurationDefinition'));
+ newFlows.push(
+ ...flows.filter(
+ flow => flow.dslName === 'RouteConfigurationDefinition' && flow.uuid !== routeConfiguration.uuid,
+ ),
+ );
+ integration.spec.flows = newFlows;
+ return integration;
+ };
+
+ static updateRouteConfigurationToIntegration = (integration: Integration, e: CamelElement): Integration => {
+ const elementClone = CamelUtil.cloneStep(e);
+ const integrationClone: Integration = CamelUtil.cloneIntegration(integration);
+
+ integrationClone.spec.flows = integration.spec.flows?.map(flow => {
+ if (flow.dslName === 'RouteConfigurationDefinition') {
+ const route = CamelDefinitionApiExt.updateElement(flow, elementClone) as RouteConfigurationDefinition;
+ return CamelDefinitionApi.createRouteConfigurationDefinition(route);
+ }
+ return flow;
+ });
+ return integrationClone;
+ };
+
+ static addRouteTemplateToIntegration = (
+ integration: Integration,
+ routeTemplate: RouteTemplateDefinition,
+ ): Integration => {
+ integration.spec.flows?.push(routeTemplate);
+ return integration;
+ };
+
+ static deleteRouteTemplateFromIntegration = (
+ integration: Integration,
+ routeTemplate: RouteTemplateDefinition,
+ ): Integration => {
+ const newFlows: any[] = [];
+ const flows: any[] = integration.spec.flows ?? [];
+ newFlows.push(...flows.filter(flow => flow.dslName !== 'RouteTemplateDefinition'));
+ newFlows.push(
+ ...flows.filter(
+ flow => flow.dslName === 'RouteTemplateDefinition' && flow.uuid !== routeTemplate.uuid,
+ ),
+ );
+ integration.spec.flows = newFlows;
+ return integration;
+ };
+
+ static deleteRouteFromIntegration = (
+ integration: Integration,
+ routeId: string,
+ ): Integration => {
+ const newFlows: any[] = [];
+ const flows: any[] = integration.spec.flows ?? [];
+ newFlows.push(...flows.filter(flow => flow.dslName !== 'RouteDefinition'));
+ newFlows.push(
+ ...flows.filter(
+ flow => flow.dslName === 'RouteDefinition' && flow.id !== routeId,
+ ),
+ );
+ integration.spec.flows = newFlows;
+ return integration;
+ };
+
+ static updateRouteTemplateToIntegration = (integration: Integration, e: CamelElement): Integration => {
+ const elementClone = CamelUtil.cloneStep(e);
+ const integrationClone: Integration = CamelUtil.cloneIntegration(integration);
+
+ integrationClone.spec.flows = integration.spec.flows?.map(flow => {
+ if (flow.dslName === 'RouteTemplateDefinition') {
+ const route = CamelDefinitionApiExt.updateElement(flow, elementClone) as RouteTemplateDefinition;
+ return CamelDefinitionApi.createRouteTemplateDefinition(route);
+ }
+ return flow;
+ });
+ return integrationClone;
+ };
+
+ static addRestToIntegration = (integration: Integration, rest: RestDefinition): Integration => {
+ integration.spec.flows?.push(rest);
+ return integration;
+ };
+
+ static addRestMethodToIntegration = (
+ integration: Integration,
+ method: CamelElement,
+ restUuid: string,
+ ): Integration => {
+ const flows: any[] = [];
+ const methodFunctions: { [key: string]: (rest: RestDefinition, method: CamelElement) => void } = {
+ GetDefinition: (rest: RestDefinition, method: CamelElement) => {
+ rest.get = CamelDefinitionApiExt.addRestMethodToRestMethods(rest.get, method);
+ },
+ PostDefinition: (rest: RestDefinition, method: CamelElement) => {
+ rest.post = CamelDefinitionApiExt.addRestMethodToRestMethods(rest.post, method);
+ },
+ PutDefinition: (rest: RestDefinition, method: CamelElement) => {
+ rest.put = CamelDefinitionApiExt.addRestMethodToRestMethods(rest.put, method);
+ },
+ PatchDefinition: (rest: RestDefinition, method: CamelElement) => {
+ rest.patch = CamelDefinitionApiExt.addRestMethodToRestMethods(rest.patch, method);
+ },
+ DeleteDefinition: (rest: RestDefinition, method: CamelElement) => {
+ rest.delete = CamelDefinitionApiExt.addRestMethodToRestMethods(rest.delete, method);
+ },
+ HeadDefinition: (rest: RestDefinition, method: CamelElement) => {
+ rest.head = CamelDefinitionApiExt.addRestMethodToRestMethods(rest.head, method);
+ },
+ };
+
+ for (let flow of integration.spec.flows ?? []) {
+ if (flow.dslName === 'RestDefinition') {
+ if (flow.uuid !== restUuid) {
+ flows.push(flow);
+ } else {
+ if (method.dslName in methodFunctions) {
+ methodFunctions[method.dslName](flow, method);
+ }
+ flows.push(flow);
+ }
+ } else {
+ flows.push(flow);
+ }
+ }
+
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static addRestMethodToRestMethods = (methods: CamelElement[] = [], method: CamelElement): CamelElement[] => {
+ const elements: CamelElement[] = [];
+ for (const e of methods) {
+ if (e.uuid === method.uuid) {
+ elements.push(method);
+ } else {
+ elements.push(e);
+ }
+ }
+ if (elements.filter(e => e.uuid === method.uuid).length === 0) {
+ elements.push(method);
+ }
+ return elements;
+ };
+
+ static findRestMethodParent = (integration: Integration, method: CamelElement): string | undefined => {
+ const rests: RestDefinition[] = integration.spec.flows?.filter(flow => flow.dslName === 'RestDefinition') ?? [];
+ const methodTypes = ['get', 'post', 'put', 'patch', 'delete', 'head'];
+
+ for (const rest of rests) {
+ for (const type of methodTypes) {
+ if (
+ method.dslName.toLowerCase() === `${type}definition` &&
+ (rest as any)[type]?.find((m: any) => m.uuid === method.uuid)
+ ) {
+ return rest.uuid;
+ }
+ }
+ }
+ };
+
+ static deleteRestConfigurationFromIntegration = (integration: Integration): Integration => {
+ const flows: any[] = [];
+
+ for (const flow of integration.spec.flows ?? []) {
+ if (flow.dslName !== 'RestConfigurationDefinition') {
+ flows.push(flow);
+ }
+ }
+
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static deleteRestFromIntegration = (integration: Integration, restUuid?: string): Integration => {
+ const flows: any[] = [];
+
+ for (const flow of integration.spec.flows ?? []) {
+ if (flow.dslName !== 'RestDefinition' || flow.uuid !== restUuid) {
+ flows.push(flow);
+ }
+ }
+
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static deleteRestMethodFromIntegration = (integration: Integration, methodUuid?: string): Integration => {
+ const flows: any[] = [];
+ const methods = ['get', 'post', 'put', 'patch', 'delete', 'head'];
+
+ for (const flow of integration.spec.flows ?? []) {
+ if (flow.dslName === 'RestDefinition') {
+ for (const method of methods) {
+ if (flow[method]) {
+ flow[method] = flow[method].filter((item: any) => item.uuid !== methodUuid);
+ }
+ }
+ }
+ flows.push(flow);
+ }
+
+ integration.spec.flows = flows;
+ return integration;
+ };
+
+ static getExpressionLanguageName = (expression: ExpressionDefinition | undefined): string | undefined => {
+ let result: string | undefined = undefined;
+ if (expression) {
+ for (const fieldName in expression) {
+ if ((expression as any)[fieldName] === undefined) {
+ continue;
+ }
+
+ const lang = Languages.find((value: [string, string, string]) => value[0] === fieldName);
+ if (lang) {
+ const camelLangMetadata = CamelMetadataApi.getCamelLanguageMetadataByName(lang[0]);
+ if (camelLangMetadata?.name) {
+ result = camelLangMetadata.name;
+ break;
+ }
+ }
+ }
+ }
+ return result;
+ };
+
+ static getExpressionLanguageClassName = (expression: ExpressionDefinition | undefined): string | undefined => {
+ let result: string | undefined = undefined;
+ if (expression) {
+ for (const fieldName in expression) {
+ if ((expression as any)[fieldName] === undefined) {
+ continue;
+ }
+
+ const lang = Languages.find((value: [string, string, string]) => value[0] === fieldName);
+ if (lang) {
+ const camelLangMetadata = CamelMetadataApi.getCamelLanguageMetadataByName(lang[0]);
+ if (camelLangMetadata?.className) {
+ result = camelLangMetadata.className;
+ break;
+ }
+ }
+ }
+ }
+ return result;
+ };
+
+ static getDataFormat = (element: CamelElement | undefined): ElementMeta | undefined => {
+ let result: ElementMeta | undefined = undefined;
+ if (element) {
+ Object.keys(element).forEach(fieldName => {
+ const df = CamelMetadataApi.getCamelDataFormatMetadataByName(fieldName);
+ result = (element as any)[fieldName] ? df : result;
+ });
+ }
+ return result;
+ }
+
+ static getExpressionValue = (expression: ExpressionDefinition | undefined): CamelElement | undefined => {
+ const language = CamelDefinitionApiExt.getExpressionLanguageName(expression);
+ if (language) {
+ return (expression as any)[language];
+ } else {
+ return undefined;
+ }
+ };
+
+ static updateIntegrationRestElement = (integration: Integration, e: CamelElement): Integration => {
+ const int: Integration = CamelUtil.cloneIntegration(integration);
+ const flows: CamelElement[] = [];
+
+ const methods = ['get', 'post', 'put', 'patch', 'delete', 'head'];
+
+ const isRest = (flow: any) => flow.dslName === 'RestDefinition' && flow.uuid === e.uuid;
+ const isRestConfig = (flow: any) => flow.dslName === 'RestConfigurationDefinition' && flow.uuid === e.uuid;
+
+ const isSingleRest = integration.spec.flows?.filter(isRest).length === 1;
+ const isSingleRestConfig = integration.spec.flows?.filter(isRestConfig).length === 1;
+
+ for (const flow of integration.spec.flows ?? []) {
+ if ((isSingleRest && isRest(flow)) || (isSingleRestConfig && isRestConfig(flow))) {
+ flows.push(CamelUtil.cloneStep(e));
+ } else if (flow.dslName === 'RestDefinition') {
+ for (const method of methods) {
+ if (flow[method]) {
+ for (let i = 0; i < flow[method].length; i++) {
+ if (flow[method][i].uuid === e.uuid) {
+ flow[method][i] = e;
+ }
+ }
+ }
+ }
+ flows.push(flow);
+ } else {
+ flows.push(flow);
+ }
+ }
+
+ int.spec.flows = flows;
+ return int;
+ };
+
+ static updateIntegrationRouteElement = (integration: Integration, e: CamelElement): Integration => {
+ const elementClone = CamelUtil.cloneStep(e);
+ const int: Integration = CamelUtil.cloneIntegration(integration);
+ const flows: CamelElement[] = [];
+
+ for (const flow of integration.spec.flows ?? []) {
+ if (flow.dslName === 'RouteDefinition') {
+ const route = CamelDefinitionApiExt.updateElement(flow, elementClone) as RouteDefinition;
+ flows.push(CamelDefinitionApi.createRouteDefinition(route));
+ } else if (flow.dslName === 'RouteConfigurationDefinition') {
+ const routeConfiguration = CamelDefinitionApiExt.updateElement(flow, elementClone) as RouteConfigurationDefinition;
+ flows.push(CamelDefinitionApi.createRouteConfigurationDefinition(routeConfiguration));
+ } else if (flow.dslName === 'RouteTemplateDefinition') {
+ const routeTemplate = CamelDefinitionApiExt.updateElement(flow, elementClone) as RouteTemplateDefinition;
+ flows.push(CamelDefinitionApi.createRouteTemplateDefinition(routeTemplate));
+ } else {
+ flows.push(flow);
+ }
+ }
+
+ int.spec.flows = flows;
+ return int;
+ };
+
+ static updateIntegrationBeanElement = (integration: Integration, e: CamelElement): Integration => {
+ const elementClone = CamelUtil.cloneStep(e);
+ const int: Integration = CamelUtil.cloneIntegration(integration);
+ const flows: CamelElement[] = [];
+
+ for (const flow of integration.spec.flows ?? []) {
+ if (flow.dslName === 'Beans') {
+ const route = CamelDefinitionApiExt.updateElement(flow, elementClone) as BeanFactoryDefinition;
+ flows.push(CamelDefinitionApi.createBeanFactoryDefinition(route));
+ } else {
+ flows.push(flow);
+ }
+ }
+
+ int.spec.flows = flows;
+ return int;
+ };
+
+ static updateElement = (element: CamelElement, e: CamelElement): CamelElement => {
+ if (element.uuid === e.uuid) {
+ return e;
+ }
+ const result: any = { ...element };
+ for (const key in result) {
+ if (result[key] instanceof CamelElement) {
+ result[key] = CamelDefinitionApiExt.updateElement(result[key], e);
+ } else if (Array.isArray(result[key])) {
+ result[key] = CamelDefinitionApiExt.updateElements(result[key], e);
+ }
+ }
+ return result as CamelElement;
+ };
+
+ static updateElements = (elements: CamelElement[], e: CamelElement): CamelElement[] => {
+ const result: any[] = [];
+ for (const element of elements) {
+ if (typeof element === 'object') {
+ const newElement = CamelDefinitionApiExt.updateElement(element, e);
+ result.push(newElement);
+ } else {
+ result.push(element);
+ }
+ }
+ return result;
+ };
+
+ static getElementProperties = (className: string | undefined): PropertyMeta[] => {
+ const result: PropertyMeta[] = [];
+ let uri: any = undefined;
+ let expression: any = undefined;
+ let parameters: any = undefined;
+
+ if (className) {
+ const properties =
+ className.endsWith('Definition') || className.endsWith('BuilderRef') || className.endsWith('Config')
+ ? CamelMetadataApi.getCamelModelMetadataByClassName(className)?.properties
+ : className.endsWith('DataFormat')
+ ? CamelMetadataApi.getCamelDataFormatMetadataByClassName(className)?.properties
+ : CamelMetadataApi.getCamelLanguageMetadataByClassName(className)?.properties;
+
+ if (properties) {
+ for (const p of properties.filter(p => p.name !== 'steps' && p.name !== 'configurationRef')) {
+ switch (p.name) {
+ case 'uri':
+ uri = p;
+ break;
+ case 'expression':
+ expression = p;
+ break;
+ case 'parameters':
+ parameters = p;
+ break;
+ default:
+ result.push(p);
+ }
+ }
+ }
+ }
+
+ if (uri) {
+ result.unshift(uri);
+ }
+ if (expression) {
+ result.unshift(expression);
+ }
+ if (parameters) {
+ result.push(parameters);
+ }
+
+ return result;
+ };
+
+ static getElementPropertiesByName = (name: string): PropertyMeta[] => {
+ const model = CamelMetadataApi.getCamelModelMetadataByName(name);
+ if (model) {
+ return CamelDefinitionApiExt.getElementProperties(model.className);
+ }
+ const language = CamelMetadataApi.getCamelLanguageMetadataByName(name);
+ if (language) {
+ return CamelDefinitionApiExt.getElementProperties(language.className);
+ }
+ const dataFormat = CamelMetadataApi.getCamelDataFormatMetadataByName(name);
+ if (dataFormat) {
+ return CamelDefinitionApiExt.getElementProperties(dataFormat.className);
+ }
+ return [];
+ };
+
+ static getParametersValue = (element: CamelElement | undefined, propertyName: string, pathParameter?: boolean): any => {
+ if (element && (element as any).parameters) {
+ return (element as any).parameters[propertyName];
+ }
+ };
+
+ static getElementChildrenDefinition = (dslName: string): ChildElement[] => {
+ const result: ChildElement[] = [];
+ const meta = CamelMetadataApi.getCamelModelMetadataByClassName(dslName);
+
+ if (meta) {
+ for (const property of meta.properties) {
+ if (property.isObject && CamelMetadataApi.getCamelModelMetadataByClassName(property.type)) {
+ result.push(new ChildElement(property.name, property.type, property.isArray));
+ }
+ }
+ }
+
+ if (CamelDefinitionApi.createStep(dslName, {}).hasSteps())
+ result.push(new ChildElement('steps', 'CamelElement', true));
+ return result;
+ };
+
+ static getElementChildren = (element: CamelElement, child: ChildElement): CamelElement[] => {
+ let children = (element as any)[child.name];
+ if (!Array.isArray(children)) {
+ children = children ? [children] : [];
+ }
+ return children;
+ };
+}
diff --git a/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionYaml.ts b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionYaml.ts
new file mode 100644
index 00000000..8239d2f9
--- /dev/null
+++ b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionYaml.ts
@@ -0,0 +1,432 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import * as yaml from 'js-yaml';
+import { Beans, CamelElement, Integration } from '../model/IntegrationDefinition';
+import {
+ BeanFactoryDefinition,
+ RouteConfigurationDefinition,
+ RouteDefinition,
+} from '../model/CamelDefinition';
+import { CamelUtil } from './CamelUtil';
+import { CamelDefinitionYamlStep } from './CamelDefinitionYamlStep';
+
+export class CamelDefinitionYaml {
+ private constructor() {
+ }
+
+ static integrationToYaml = (integration: Integration): string => {
+ const clone: any = CamelUtil.cloneIntegration(integration);
+ const flows = integration.spec.flows;
+ clone.spec.flows = flows
+ ?.map((f: any) => CamelDefinitionYaml.cleanupElement(f))
+ .filter(x => Object.keys(x).length !== 0);
+ if (integration.type === 'crd') {
+ delete clone.type;
+ const i = JSON.parse(JSON.stringify(clone, (key, value) => CamelDefinitionYaml.replacer(key, value), 3)); // fix undefined in string attributes
+ return CamelDefinitionYaml.yamlDump(i);
+ } else if (integration.type === 'kamelet') {
+ delete clone.type;
+ // turn array of flows to object properties in template for Kamelet
+ const template: any = {route: {}}
+ const route: RouteDefinition = clone.spec.flows.filter((f: any) => f.dslName === 'RouteDefinition')?.[0];
+ if (route) {
+ template.route = Object.assign(template.route, route);
+ } else if (clone.spec.template?.route) {
+ template.route = clone.spec.template.route;
+ } else if (clone.spec.template?.from) {
+ template.route = {from: clone.spec.template?.from};
+ }
+ const from: RouteDefinition = clone.spec.flows.filter((f: any) => f.dslName === 'FromDefinition')?.[0];
+ if (from) {
+ template.from = {from: from};
+ }
+ const beans = clone.spec.flows.filter((f: any) => f.dslName === 'Beans')?.at(0)?.beans;
+ if (beans) {
+ template.beans = beans;
+ } else if (clone.spec.template?.beans){
+ template.beans = clone.spec.template.beans;
+ }
+ clone.spec.template = template;
+ delete clone.spec.flows;
+ const i = JSON.parse(JSON.stringify(clone, (key, value) => CamelDefinitionYaml.replacer(key, value, true), 3)); // fix undefined in string attributes
+ return CamelDefinitionYaml.yamlDump(i);
+ } else {
+ const f = JSON.parse(
+ JSON.stringify(clone.spec.flows, (key, value) => CamelDefinitionYaml.replacer(key, value), 3),
+ );
+ return CamelDefinitionYaml.yamlDump(f);
+ }
+ };
+
+ static isEmpty = (value?: string): boolean => {
+ return value === undefined || (value.trim && value.trim().length === 0);
+ };
+
+ static isEmptyObject(obj: any): boolean {
+ // Check if it's an object and not null
+ if (obj && typeof obj === 'object') {
+ // Get all enumerable property names
+ const keys = Object.keys(obj);
+ // Get all non-enumerable property names
+ const nonEnumProps = Object.getOwnPropertyNames(obj);
+ // Check if there are no properties
+ return keys.length === 0 && nonEnumProps.length === 0;
+ }
+ return false;
+ }
+
+
+ static cleanupElement = (element: CamelElement, inArray?: boolean, inSteps?: boolean): CamelElement => {
+ const result: any = {};
+ const object: any = { ...element };
+
+ if (inArray) {
+ object.inArray = inArray;
+ object.inSteps = !!inSteps;
+ }
+
+ if (object.dslName === 'RouteTemplateDefinition') {
+ object.route.inArray = true;
+ } else if (object.dslName?.endsWith('Expression')) {
+ delete object.language;
+ delete object.expressionName;
+ } else if (object.dslName?.endsWith('DataFormat')) {
+ delete object.dataFormatName;
+ } else if (object.dslName === 'BeanFactoryDefinition') {
+ if (object.properties && Object.keys(object.properties).length === 0) {
+ delete object.properties;
+ }
+ if (object.constructors && CamelDefinitionYaml.isEmptyObject(object.constructors)) {
+ delete object.constructors;
+ }
+ } else if (['CatchDefinition', 'OnExceptionDefinition', 'OnCompletionDefinition', 'Resilience4jConfigurationDefinition'].includes(object.dslName) && object?.onWhen?.stepName !== undefined) {
+ object.onWhen.stepName = 'onWhen'; // https://github.com/apache/camel-karavan/issues/1420
+ }
+
+ delete object.uuid;
+ delete object.showChildren;
+
+ for (const [key, value] of Object.entries(object) as [string, any][]) {
+ if (value instanceof CamelElement || (typeof value === 'object' && value?.dslName)) {
+ result[key] = CamelDefinitionYaml.cleanupElement(value);
+ } else if (Array.isArray(value)) {
+ if (value.length > 0) {
+ result[key] = CamelDefinitionYaml.cleanupElements(value, key === 'steps');
+ }
+ } else if (key === 'parameters' && typeof value === 'object') {
+ const parameters = Object.entries(value || {})
+ .filter(([_, v]: [string, any]) => !CamelDefinitionYaml.isEmpty(v))
+ .reduce((x: any, [k, v]) => ({ ...x, [k]: v }), {});
+ if (Object.keys(parameters).length > 0) {
+ result[key] = parameters;
+ }
+ } else {
+ if (!CamelDefinitionYaml.isEmpty(value)) {
+ result[key] = value;
+ }
+ }
+ }
+ return result as CamelElement;
+ };
+
+ static cleanupElements = (elements: CamelElement[], inSteps?: boolean): CamelElement[] => {
+ const result: any[] = [];
+ for (const element of elements) {
+ if (typeof element === 'object') {
+ result.push(CamelDefinitionYaml.cleanupElement(element, true, inSteps));
+ } else {
+ result.push(element);
+ }
+ }
+ return result;
+ };
+
+ static yamlDump = (integration: any): string => {
+ return yaml.dump(integration, {
+ noRefs: false,
+ noArrayIndent: false,
+ lineWidth: 170,
+ // forceQuotes: true,
+ quotingType: '"',
+ sortKeys: function(a: any, b: any) {
+ if (a === 'steps') return 1;
+ else if (b === 'steps') return -1;
+ else return 0;
+ },
+ });
+ };
+
+ static replacer = (key: string, value: any, isKamelet: boolean = false): any => {
+ if (
+ typeof value === 'object' &&
+ (value.hasOwnProperty('stepName') || value.hasOwnProperty('inArray') || value.hasOwnProperty('inSteps'))
+ ) {
+ const stepNameField = value.hasOwnProperty('stepName') ? 'stepName' : 'step-name';
+ const stepName = value[stepNameField];
+ const dslName = value.dslName;
+ let newValue: any = JSON.parse(JSON.stringify(value));
+ delete newValue.dslName;
+ delete newValue[stepNameField];
+
+ if (
+ value.inArray &&
+ !value.inSteps &&
+ ['intercept', 'interceptFrom', 'interceptSendToEndpoint', 'onCompletion', 'onException'].includes(
+ stepName,
+ )
+ ) {
+ delete newValue.inArray;
+ delete newValue.inSteps;
+ const xValue: any = {};
+ xValue[stepName] = newValue;
+ return xValue;
+ } else if (value.inArray && dslName === 'RouteDefinition' && !isKamelet ) { // route in RouteTemplate
+ delete value?.dslName;
+ delete value?.stepName;
+ delete value?.inArray;
+ return value;
+ } else if (
+ (value.inArray && !value.inSteps) ||
+ dslName === 'ExpressionSubElementDefinition' ||
+ dslName === 'ExpressionDefinition' ||
+ dslName?.endsWith('Expression') ||
+ stepName === 'otherwise' ||
+ stepName === 'doFinally' ||
+ stepName === 'resilience4jConfiguration' ||
+ stepName === 'faultToleranceConfiguration' ||
+ stepName === 'errorHandler' ||
+ stepName === 'onWhen' || // https://github.com/apache/camel-karavan/issues/1420
+ stepName === 'deadLetterChannel' ||
+ stepName === 'defaultErrorHandler' ||
+ stepName === 'jtaTransactionErrorHandler' ||
+ stepName === 'noErrorHandler' ||
+ stepName === 'springTransactionErrorHandler' ||
+ stepName === 'redeliveryPolicy' ||
+ stepName === 'securityDefinitions' ||
+ stepName === 'apiKey' ||
+ stepName === 'basicAuth' ||
+ stepName === 'bearer' ||
+ stepName === 'mutualTls' ||
+ stepName === 'oauth2' ||
+ stepName === 'openIdConnect' ||
+ stepName === 'openApi' ||
+ key === 'from'
+ ) {
+ delete newValue.inArray;
+ delete newValue.inSteps;
+ return newValue;
+ } else if (isKamelet && dslName === 'RouteDefinition') {
+ delete value?.dslName;
+ delete value?.stepName;
+ return value;
+ } else {
+ delete newValue.inArray;
+ delete newValue.inSteps;
+ const xValue: any = {};
+ xValue[stepName] = newValue;
+ return xValue;
+ }
+ } else {
+ if (value?.dslName === 'YAMLDataFormat') { // YAMLDataFormat constructor field
+ value.constructor = value._constructor;
+ delete value._constructor;
+ }
+ delete value?.dslName;
+ return value;
+ }
+ };
+
+ static yamlToIntegration = (filename: string, text: string): Integration => {
+ const integration: Integration = Integration.createNew(filename);
+ const fromYaml: any = yaml.load(text);
+ const camelized: any = CamelUtil.camelizeObject(fromYaml);
+ if (camelized?.apiVersion && camelized.apiVersion.startsWith('camel.apache.org') && camelized.kind) {
+ if (camelized?.metadata) {
+ integration.metadata = camelized?.metadata;
+ }
+ if (camelized?.spec) {
+ integration.spec.definition = camelized?.spec.definition;
+ integration.spec.dependencies = camelized?.spec.dependencies;
+ integration.spec.types = camelized?.spec.types;
+ }
+ const int: Integration = new Integration({ ...camelized });
+ if (camelized.kind === 'Integration') {
+ integration.type = 'crd';
+ integration.spec.flows?.push(...CamelDefinitionYaml.flowsToCamelElements(int.spec.flows || []));
+ } else if (camelized.kind === 'Kamelet') {
+ integration.type = 'kamelet';
+ integration.kind = 'Kamelet';
+ const flows: any[] = [];
+ // turn kamelet template object properties to array of flows
+ const beans = int.spec.template?.beans;
+ if (beans) {
+ flows.push(new Beans({beans: beans}))
+ }
+ const from = int.spec.template?.from;
+ if (from) {
+ flows.push(new RouteDefinition({from: from}))
+ } else {
+ const route = int.spec.template?.route;
+ flows.push(route);
+ }
+ integration.spec.flows?.push(...CamelDefinitionYaml.flowsToCamelElements(flows || []));
+ }
+ } else if (Array.isArray(camelized)) {
+ integration.type = 'plain';
+ const flows: any[] = camelized;
+ integration.spec.flows?.push(...CamelDefinitionYaml.flowsToCamelElements(flows));
+ }
+ return integration;
+ };
+
+ static yamlIsIntegration = (text: string): 'crd' | 'plain' | 'kamelet' | 'none' => {
+ try {
+ const fromYaml: any = yaml.load(text);
+ const camelized: any = CamelUtil.camelizeObject(fromYaml);
+ if (camelized?.apiVersion && camelized.apiVersion.startsWith('camel.apache.org') && camelized.kind) {
+ if (camelized.kind === 'Integration') {
+ return 'crd';
+ } else if (camelized.kind === 'Kamelet') {
+ return 'kamelet';
+ }
+ } else if (Array.isArray(camelized)) {
+ return 'plain';
+ } else {
+ return 'none';
+ }
+ } catch (e) {
+ }
+ return 'none';
+ };
+ static flowsToCamelElements = (flows: any[]): any[] => {
+ const result: any[] = [];
+ flows.filter((e: any) => e.hasOwnProperty('restConfiguration'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRestConfigurationDefinition(f.restConfiguration)));
+ flows.filter((e: any) => e.hasOwnProperty('rest'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRestDefinition(f.rest)));
+ flows.filter((e: any) => e.hasOwnProperty('routeTemplate'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteTemplateDefinition(f.routeTemplate)));
+ flows.filter((e: any) => e.hasOwnProperty('templatedRoute'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readTemplatedRouteDefinition(f.templatedRoute)));
+ flows.filter((e: any) => e.hasOwnProperty('route'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteDefinition(f.route)));
+ flows.filter((e: any) => e.hasOwnProperty('from'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteDefinition(new RouteDefinition({from: f.from, id: f.id}))));
+ flows.filter((e: any) => e.hasOwnProperty('beans'))
+ .forEach((b: any) => result.push(CamelDefinitionYaml.readBeanDefinition(b)));
+ flows.filter((e: any) => e.hasOwnProperty('routeConfiguration'))
+ .forEach((e: any) => result.push(CamelDefinitionYamlStep.readRouteConfigurationDefinition(e.routeConfiguration)));
+ flows.filter((e: any) => e.hasOwnProperty('errorHandler'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteConfigurationDefinition(new RouteConfigurationDefinition({errorHandler: f.errorHandler}))));
+ flows.filter((e: any) => e.hasOwnProperty('onException'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteConfigurationDefinition(new RouteConfigurationDefinition({onException: f.onException}))));
+ flows.filter((e: any) => e.hasOwnProperty('intercept'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteConfigurationDefinition(new RouteConfigurationDefinition({intercept: f.intercept}))));
+ flows.filter((e: any) => e.hasOwnProperty('interceptFrom'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteConfigurationDefinition(new RouteConfigurationDefinition({interceptFrom: f.interceptFrom}))));
+ flows.filter((e: any) => e.hasOwnProperty('interceptSendToEndpoint'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteConfigurationDefinition(new RouteConfigurationDefinition({interceptSendToEndpoint: f.interceptSendToEndpoint}))));
+ flows.filter((e: any) => e.hasOwnProperty('onCompletion'))
+ .forEach((f: any) => result.push(CamelDefinitionYamlStep.readRouteConfigurationDefinition(new RouteConfigurationDefinition({onCompletion: f.onCompletion}))));
+
+ return result;
+ };
+
+ static readBeanDefinition = (beans: any): Beans => {
+ const result: Beans = new Beans();
+ for (const bean of beans.beans) {
+ const props: any = {};
+ if (bean && bean.properties) {
+ // convert map style to properties if requires
+ for (const [key, value] of Object.entries(bean.properties)) {
+ CamelDefinitionYaml.flatMapProperty(key, value, new Map<string, any>()).forEach(
+ (v, k) => (props[k] = v),
+ );
+ }
+ }
+ if (bean && bean.property && Array.isArray(bean.property)) {
+ // convert map style to properties if requires
+ Array.from(bean.property).forEach((val: any) => {
+ props[val.key] = val.value;
+ })
+ delete bean.property;
+ }
+ bean.properties = props;
+ result.beans.push(new BeanFactoryDefinition(bean));
+ }
+ return result;
+ };
+
+ // convert map style to properties if requires
+ static flatMapProperty = (key: string, value: any, properties: Map<string, any>): Map<string, any> => {
+ if (value === undefined) {
+ return properties;
+ }
+
+ if (typeof value === 'object') {
+ for (const k in value) {
+ const key2 = key + '.' + k;
+ const value2: any = value[k];
+ CamelDefinitionYaml.flatMapProperty(key2, value2, new Map<string, any>()).forEach((value1, key1) =>
+ properties.set(key1, value1),
+ );
+ }
+ } else {
+ properties.set(key, value);
+ }
+ return properties;
+ };
+
+ // add generated Integration YAML into existing Integration YAML
+ static addYamlToIntegrationYaml = (
+ filename: string,
+ camelYaml: string | undefined,
+ restYaml: string,
+ addREST: boolean,
+ addRoutes: boolean,
+ ): string => {
+ const existing =
+ camelYaml !== undefined
+ ? CamelDefinitionYaml.yamlToIntegration(filename, camelYaml)
+ : Integration.createNew(filename);
+ const generated = CamelDefinitionYaml.yamlToIntegration(filename, restYaml);
+
+ const flows: CamelElement[] =
+ existing.spec.flows?.filter(f => !['RouteDefinition', 'RestDefinition'].includes(f.dslName)) || [];
+
+ const restE: CamelElement[] = existing.spec.flows?.filter(f => f.dslName === 'RestDefinition') || [];
+ const restG: CamelElement[] = generated.spec.flows?.filter(f => f.dslName === 'RestDefinition') || [];
+
+ if (addREST) {
+ flows.push(...restG);
+ } else {
+ flows.push(...restE);
+ }
+
+ const routeE: CamelElement[] = existing.spec.flows?.filter(f => f.dslName === 'RouteDefinition') || [];
+ const routeG: CamelElement[] = generated.spec.flows?.filter(f => f.dslName === 'RouteDefinition') || [];
+
+ if (addRoutes) {
+ flows.push(...routeG);
+ } else {
+ flows.push(...routeE);
+ }
+
+ existing.spec.flows = flows;
+ return CamelDefinitionYaml.integrationToYaml(existing);
+ };
+}
diff --git a/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionYamlStep.ts b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionYamlStep.ts
new file mode 100644
index 00000000..bbc3bf6d
--- /dev/null
+++ b/karavan-app/src/main/webui/src/karavan-core/api/CamelDefinitionYamlStep.ts
@@ -0,0 +1,4946 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Generated by karavan build tools - do NOT edit this file!
+ */
+import {CamelElement} from "../model/IntegrationDefinition";
+import {
+
+ ProcessorDefinition,
+ BeansDeserializer,
+ DataFormatsDefinitionDeserializer,
+ ErrorHandlerDeserializer,
+ OutputAwareFromDefinition,
+ AggregateDefinition,
+ BeanDefinition,
+ BeanFactoryDefinition,
+ CatchDefinition,
+ ChoiceDefinition,
+ CircuitBreakerDefinition,
+ ClaimCheckDefinition,
+ ContextScanDefinition,
+ ConvertBodyDefinition,
+ ConvertHeaderDefinition,
+ ConvertVariableDefinition,
+ DataFormatDefinition,
+ DelayDefinition,
+ DynamicRouterDefinition,
+ EnrichDefinition,
+ ErrorHandlerDefinition,
+ ExpressionSubElementDefinition,
+ FaultToleranceConfigurationDefinition,
+ FilterDefinition,
+ FinallyDefinition,
+ FromDefinition,
+ GlobalOptionDefinition,
+ GlobalOptionsDefinition,
+ IdempotentConsumerDefinition,
+ InputTypeDefinition,
+ InterceptDefinition,
+ InterceptFromDefinition,
+ InterceptSendToEndpointDefinition,
+ KameletDefinition,
+ LoadBalanceDefinition,
+ LogDefinition,
+ LoopDefinition,
+ MarshalDefinition,
+ MulticastDefinition,
+ OnCompletionDefinition,
+ OnExceptionDefinition,
+ OnFallbackDefinition,
+ OnWhenDefinition,
+ OptimisticLockRetryPolicyDefinition,
+ OtherwiseDefinition,
+ OutputDefinition,
+ OutputTypeDefinition,
+ PackageScanDefinition,
+ PausableDefinition,
+ PipelineDefinition,
+ PolicyDefinition,
+ PollDefinition,
+ PollEnrichDefinition,
+ ProcessDefinition,
+ PropertyDefinition,
+ PropertyExpressionDefinition,
+ RecipientListDefinition,
+ RedeliveryPolicyDefinition,
+ RemoveHeaderDefinition,
+ RemoveHeadersDefinition,
+ RemovePropertiesDefinition,
+ RemovePropertyDefinition,
+ RemoveVariableDefinition,
+ ResequenceDefinition,
+ Resilience4jConfigurationDefinition,
+ RestContextRefDefinition,
+ ResumableDefinition,
+ RollbackDefinition,
+ RouteBuilderDefinition,
+ RouteConfigurationContextRefDefinition,
+ RouteConfigurationDefinition,
+ RouteContextRefDefinition,
+ RouteDefinition,
+ RouteTemplateDefinition,
+ RouteTemplateParameterDefinition,
+ RoutingSlipDefinition,
+ SagaActionUriDefinition,
+ SagaDefinition,
+ SamplingDefinition,
+ ScriptDefinition,
+ SetBodyDefinition,
+ SetExchangePatternDefinition,
+ SetHeaderDefinition,
+ SetHeadersDefinition,
+ SetPropertyDefinition,
+ SetVariableDefinition,
+ SetVariablesDefinition,
+ SortDefinition,
+ SplitDefinition,
+ StepDefinition,
+ StopDefinition,
+ TemplatedRouteDefinition,
+ TemplatedRouteParameterDefinition,
+ ThreadPoolProfileDefinition,
+ ThreadsDefinition,
+ ThrottleDefinition,
+ ThrowExceptionDefinition,
+ ToDefinition,
+ ToDynamicDefinition,
+ TokenizerDefinition,
+ TokenizerImplementationDefinition,
+ TransactedDefinition,
+ TransformDefinition,
+ TryDefinition,
+ UnmarshalDefinition,
+ ValidateDefinition,
+ ValueDefinition,
+ WhenDefinition,
+ WireTapDefinition,
+ BeanConstructorDefinition,
+ BeanConstructorsDefinition,
+ BeanPropertiesDefinition,
+ BeanPropertyDefinition,
+ ComponentScanDefinition,
+ BatchResequencerConfig,
+ StreamResequencerConfig,
+ ASN1DataFormat,
+ AvroDataFormat,
+ BarcodeDataFormat,
+ Base64DataFormat,
+ BeanioDataFormat,
+ BindyDataFormat,
+ CBORDataFormat,
+ CryptoDataFormat,
+ CsvDataFormat,
+ CustomDataFormat,
+ DataFormatsDefinition,
+ DfdlDataFormat,
+ FhirJsonDataFormat,
+ FhirXmlDataFormat,
+ FlatpackDataFormat,
+ ForyDataFormat,
+ GrokDataFormat,
+ GzipDeflaterDataFormat,
+ HL7DataFormat,
+ IcalDataFormat,
+ Iso8583DataFormat,
+ JacksonXMLDataFormat,
+ JaxbDataFormat,
+ JsonApiDataFormat,
+ JsonDataFormat,
+ LZFDataFormat,
+ MimeMultipartDataFormat,
+ PGPDataFormat,
+ ParquetAvroDataFormat,
+ ProtobufDataFormat,
+ RssDataFormat,
+ SmooksDataFormat,
+ SoapDataFormat,
+ SwiftMtDataFormat,
+ SwiftMxDataFormat,
+ SyslogDataFormat,
+ TarFileDataFormat,
+ ThriftDataFormat,
+ TidyMarkupDataFormat,
+ UniVocityCsvDataFormat,
+ UniVocityFixedDataFormat,
+ UniVocityHeader,
+ UniVocityTsvDataFormat,
+ XMLSecurityDataFormat,
+ YAMLDataFormat,
+ YAMLTypeFilterDefinition,
+ ZipDeflaterDataFormat,
+ ZipFileDataFormat,
+ DeadLetterChannelDefinition,
+ DefaultErrorHandlerDefinition,
+ JtaTransactionErrorHandlerDefinition,
+ NoErrorHandlerDefinition,
+ RefErrorHandlerDefinition,
+ SpringTransactionErrorHandlerDefinition,
+ CSimpleExpression,
+ ConstantExpression,
+ DatasonnetExpression,
+ ExchangePropertyExpression,
+ ExpressionDefinition,
+ GroovyExpression,
+ HeaderExpression,
+ Hl7TerserExpression,
+ JavaExpression,
+ JavaScriptExpression,
+ JqExpression,
+ JsonPathExpression,
+ LanguageExpression,
+ MethodCallExpression,
+ MvelExpression,
+ PythonExpression,
+ RefExpression,
+ SimpleExpression,
+ SpELExpression,
+ TokenizerExpression,
+ VariableExpression,
+ WasmExpression,
+ XMLTokenizerExpression,
+ XPathExpression,
+ XQueryExpression,
+ CustomLoadBalancerDefinition,
+ FailoverLoadBalancerDefinition,
+ RandomLoadBalancerDefinition,
+ RoundRobinLoadBalancerDefinition,
+ StickyLoadBalancerDefinition,
+ TopicLoadBalancerDefinition,
+ WeightedLoadBalancerDefinition,
+ ApiKeyDefinition,
+ BasicAuthDefinition,
+ BearerTokenDefinition,
+ DeleteDefinition,
+ GetDefinition,
+ HeadDefinition,
+ MutualTLSDefinition,
+ OAuth2Definition,
+ OpenApiDefinition,
+ OpenIdConnectDefinition,
+ ParamDefinition,
+ PatchDefinition,
+ PostDefinition,
+ PutDefinition,
+ ResponseHeaderDefinition,
+ ResponseMessageDefinition,
+ RestBindingDefinition,
+ RestConfigurationDefinition,
+ RestDefinition,
+ RestPropertyDefinition,
+ RestSecuritiesDefinition,
+ RestsDefinition,
+ SecurityDefinition,
+ LangChain4jCharacterTokenizerDefinition,
+ LangChain4jLineTokenizerDefinition,
+ LangChain4jParagraphTokenizerDefinition,
+ LangChain4jSentenceTokenizerDefinition,
+ LangChain4jTokenizerDefinition,
+ LangChain4jWordTokenizerDefinition,
+ CustomTransformerDefinition,
+ DataFormatTransformerDefinition,
+ EndpointTransformerDefinition,
+ LoadTransformerDefinition,
+ TransformersDefinition,
+ CustomValidatorDefinition,
+ EndpointValidatorDefinition,
+ PredicateValidatorDefinition,
+ ValidatorsDefinition,
+} from '../model/CamelDefinition';
+import {CamelUtil} from './CamelUtil';
+import {CamelMetadataApi} from '../model/CamelMetadata';
+import {ComponentApi} from './ComponentApi';
+
+export class CamelDefinitionYamlStep {
+
+ static readProcessorDefinition = (element: any): ProcessorDefinition => {
+
+ let def = element ? new ProcessorDefinition({...element}) : new ProcessorDefinition();
+ if (element?.idempotentConsumer !== undefined) {
+ if (Array.isArray(element.idempotentConsumer)) {
+ def.idempotentConsumer = CamelDefinitionYamlStep.readIdempotentConsumerDefinition(element.idempotentConsumer[0]);
+ } else {
+ def.idempotentConsumer = CamelDefinitionYamlStep.readIdempotentConsumerDefinition(element.idempotentConsumer);
+ }
+ }
+ if (element?.resumable !== undefined) {
+ if (Array.isArray(element.resumable)) {
+ def.resumable = CamelDefinitionYamlStep.readResumableDefinition(element.resumable[0]);
+ } else {
+ def.resumable = CamelDefinitionYamlStep.readResumableDefinition(element.resumable);
+ }
+ }
+ if (element?.doTry !== undefined) {
+ if (Array.isArray(element.doTry)) {
+ def.doTry = CamelDefinitionYamlStep.readTryDefinition(element.doTry[0]);
+ } else {
+ def.doTry = CamelDefinitionYamlStep.readTryDefinition(element.doTry);
+ }
+ }
+ if (element?.convertBodyTo !== undefined) {
+ if (Array.isArray(element.convertBodyTo)) {
+ def.convertBodyTo = CamelDefinitionYamlStep.readConvertBodyDefinition(element.convertBodyTo[0]);
+ } else {
+ def.convertBodyTo = CamelDefinitionYamlStep.readConvertBodyDefinition(element.convertBodyTo);
+ }
+ }
+ if (element?.poll !== undefined) {
+ if (Array.isArray(element.poll)) {
+ def.poll = CamelDefinitionYamlStep.readPollDefinition(element.poll[0]);
+ } else {
+ def.poll = CamelDefinitionYamlStep.readPollDefinition(element.poll);
+ }
+ }
+ if (element?.recipientList !== undefined) {
+ if (Array.isArray(element.recipientList)) {
+ def.recipientList = CamelDefinitionYamlStep.readRecipientListDefinition(element.recipientList[0]);
+ } else {
+ def.recipientList = CamelDefinitionYamlStep.readRecipientListDefinition(element.recipientList);
+ }
+ }
+ if (element?.setHeader !== undefined) {
+ if (Array.isArray(element.setHeader)) {
+ def.setHeader = CamelDefinitionYamlStep.readSetHeaderDefinition(element.setHeader[0]);
+ } else {
+ def.setHeader = CamelDefinitionYamlStep.readSetHeaderDefinition(element.setHeader);
+ }
+ }
+ if (element?.split !== undefined) {
+ if (Array.isArray(element.split)) {
+ def.split = CamelDefinitionYamlStep.readSplitDefinition(element.split[0]);
+ } else {
+ def.split = CamelDefinitionYamlStep.readSplitDefinition(element.split);
+ }
+ }
+ if (element?.loop !== undefined) {
+ if (Array.isArray(element.loop)) {
+ def.loop = CamelDefinitionYamlStep.readLoopDefinition(element.loop[0]);
+ } else {
+ def.loop = CamelDefinitionYamlStep.readLoopDefinition(element.loop);
+ }
+ }
+ if (element?.setExchangePattern !== undefined) {
+ if (Array.isArray(element.setExchangePattern)) {
+ def.setExchangePattern = CamelDefinitionYamlStep.readSetExchangePatternDefinition(element.setExchangePattern[0]);
+ } else {
+ def.setExchangePattern = CamelDefinitionYamlStep.readSetExchangePatternDefinition(element.setExchangePattern);
+ }
+ }
+ if (element?.marshal !== undefined) {
+ if (Array.isArray(element.marshal)) {
+ def.marshal = CamelDefinitionYamlStep.readMarshalDefinition(element.marshal[0]);
+ } else {
+ def.marshal = CamelDefinitionYamlStep.readMarshalDefinition(element.marshal);
+ }
+ }
+ if (element?.circuitBreaker !== undefined) {
+ if (Array.isArray(element.circuitBreaker)) {
+ def.circuitBreaker = CamelDefinitionYamlStep.readCircuitBreakerDefinition(element.circuitBreaker[0]);
+ } else {
+ def.circuitBreaker = CamelDefinitionYamlStep.readCircuitBreakerDefinition(element.circuitBreaker);
+ }
+ }
+ if (element?.enrich !== undefined) {
+ if (Array.isArray(element.enrich)) {
+ def.enrich = CamelDefinitionYamlStep.readEnrichDefinition(element.enrich[0]);
+ } else {
+ def.enrich = CamelDefinitionYamlStep.readEnrichDefinition(element.enrich);
+ }
+ }
+ if (element?.kamelet !== undefined) {
+ if (Array.isArray(element.kamelet)) {
+ def.kamelet = CamelDefinitionYamlStep.readKameletDefinition(element.kamelet[0]);
+ } else {
+ def.kamelet = CamelDefinitionYamlStep.readKameletDefinition(element.kamelet);
+ }
+ }
+ if (element?.saga !== undefined) {
+ if (Array.isArray(element.saga)) {
+ def.saga = CamelDefinitionYamlStep.readSagaDefinition(element.saga[0]);
+ } else {
+ def.saga = CamelDefinitionYamlStep.readSagaDefinition(element.saga);
+ }
+ }
+ if (element?.bean !== undefined) {
+ if (Array.isArray(element.bean)) {
+ def.bean = CamelDefinitionYamlStep.readBeanDefinition(element.bean[0]);
+ } else {
+ def.bean = CamelDefinitionYamlStep.readBeanDefinition(element.bean);
+ }
+ }
+ if (element?.sort !== undefined) {
+ if (Array.isArray(element.sort)) {
+ def.sort = CamelDefinitionYamlStep.readSortDefinition(element.sort[0]);
+ } else {
+ def.sort = CamelDefinitionYamlStep.readSortDefinition(element.sort);
+ }
+ }
+ if (element?.loadBalance !== undefined) {
+ if (Array.isArray(element.loadBalance)) {
+ def.loadBalance = CamelDefinitionYamlStep.readLoadBalanceDefinition(element.loadBalance[0]);
+ } else {
+ def.loadBalance = CamelDefinitionYamlStep.readLoadBalanceDefinition(element.loadBalance);
+ }
+ }
+ if (element?.script !== undefined) {
+ if (Array.isArray(element.script)) {
+ def.script = CamelDefinitionYamlStep.readScriptDefinition(element.script[0]);
+ } else {
+ def.script = CamelDefinitionYamlStep.readScriptDefinition(element.script);
+ }
+ }
+ if (element?.removeHeader !== undefined) {
+ if (Array.isArray(element.removeHeader)) {
+ def.removeHeader = CamelDefinitionYamlStep.readRemoveHeaderDefinition(element.removeHeader[0]);
+ } else {
+ def.removeHeader = CamelDefinitionYamlStep.readRemoveHeaderDefinition(element.removeHeader);
+ }
+ }
+ if (element?.delay !== undefined) {
+ if (Array.isArray(element.delay)) {
+ def.delay = CamelDefinitionYamlStep.readDelayDefinition(element.delay[0]);
+ } else {
+ def.delay = CamelDefinitionYamlStep.readDelayDefinition(element.delay);
+ }
+ }
+ if (element?.stop !== undefined) {
+ if (Array.isArray(element.stop)) {
+ def.stop = CamelDefinitionYamlStep.readStopDefinition(element.stop[0]);
+ } else {
+ def.stop = CamelDefinitionYamlStep.readStopDefinition(element.stop);
+ }
+ }
+ if (element?.setProperty !== undefined) {
+ if (Array.isArray(element.setProperty)) {
+ def.setProperty = CamelDefinitionYamlStep.readSetPropertyDefinition(element.setProperty[0]);
+ } else {
+ def.setProperty = CamelDefinitionYamlStep.readSetPropertyDefinition(element.setProperty);
+ }
+ }
+ if (element?.removeProperty !== undefined) {
+ if (Array.isArray(element.removeProperty)) {
+ def.removeProperty = CamelDefinitionYamlStep.readRemovePropertyDefinition(element.removeProperty[0]);
+ } else {
+ def.removeProperty = CamelDefinitionYamlStep.readRemovePropertyDefinition(element.removeProperty);
+ }
+ }
+ if (element?.convertHeaderTo !== undefined) {
+ if (Array.isArray(element.convertHeaderTo)) {
+ def.convertHeaderTo = CamelDefinitionYamlStep.readConvertHeaderDefinition(element.convertHeaderTo[0]);
+ } else {
+ def.convertHeaderTo = CamelDefinitionYamlStep.readConvertHeaderDefinition(element.convertHeaderTo);
+ }
+ }
+ if (element?.pausable !== undefined) {
+ if (Array.isArray(element.pausable)) {
+ def.pausable = CamelDefinitionYamlStep.readPausableDefinition(element.pausable[0]);
+ } else {
+ def.pausable = CamelDefinitionYamlStep.readPausableDefinition(element.pausable);
+ }
+ }
+ if (element?.throttle !== undefined) {
+ if (Array.isArray(element.throttle)) {
+ def.throttle = CamelDefinitionYamlStep.readThrottleDefinition(element.throttle[0]);
+ } else {
+ def.throttle = CamelDefinitionYamlStep.readThrottleDefinition(element.throttle);
+ }
+ }
+ if (element?.doFinally !== undefined) {
+ if (Array.isArray(element.doFinally)) {
+ def.doFinally = CamelDefinitionYamlStep.readFinallyDefinition(element.doFinally[0]);
+ } else {
+ def.doFinally = CamelDefinitionYamlStep.readFinallyDefinition(element.doFinally);
+ }
+ }
+ if (element?.log !== undefined) {
+ if (Array.isArray(element.log)) {
+ def.log = CamelDefinitionYamlStep.readLogDefinition(element.log[0]);
+ } else {
+ def.log = CamelDefinitionYamlStep.readLogDefinition(element.log);
+ }
+ }
+ if (element?.doCatch !== undefined) {
+ if (Array.isArray(element.doCatch)) {
+ def.doCatch = CamelDefinitionYamlStep.readCatchDefinition(element.doCatch[0]);
+ } else {
+ def.doCatch = CamelDefinitionYamlStep.readCatchDefinition(element.doCatch);
+ }
+ }
+ if (element?.transacted !== undefined) {
+ if (Array.isArray(element.transacted)) {
+ def.transacted = CamelDefinitionYamlStep.readTransactedDefinition(element.transacted[0]);
+ } else {
+ def.transacted = CamelDefinitionYamlStep.readTransactedDefinition(element.transacted);
+ }
+ }
+ if (element?.claimCheck !== undefined) {
+ if (Array.isArray(element.claimCheck)) {
+ def.claimCheck = CamelDefinitionYamlStep.readClaimCheckDefinition(element.claimCheck[0]);
+ } else {
+ def.claimCheck = CamelDefinitionYamlStep.readClaimCheckDefinition(element.claimCheck);
+ }
+ }
+ if (element?.pollEnrich !== undefined) {
+ if (Array.isArray(element.pollEnrich)) {
+ def.pollEnrich = CamelDefinitionYamlStep.readPollEnrichDefinition(element.pollEnrich[0]);
+ } else {
+ def.pollEnrich = CamelDefinitionYamlStep.readPollEnrichDefinition(element.pollEnrich);
+ }
+ }
+ if (element?.removeHeaders !== undefined) {
+ if (Array.isArray(element.removeHeaders)) {
+ def.removeHeaders = CamelDefinitionYamlStep.readRemoveHeadersDefinition(element.removeHeaders[0]);
+ } else {
+ def.removeHeaders = CamelDefinitionYamlStep.readRemoveHeadersDefinition(element.removeHeaders);
+ }
+ }
+ if (element?.aggregate !== undefined) {
+ if (Array.isArray(element.aggregate)) {
+ def.aggregate = CamelDefinitionYamlStep.readAggregateDefinition(element.aggregate[0]);
+ } else {
+ def.aggregate = CamelDefinitionYamlStep.readAggregateDefinition(element.aggregate);
+ }
+ }
+ if (element?.resequence !== undefined) {
+ if (Array.isArray(element.resequence)) {
+ def.resequence = CamelDefinitionYamlStep.readResequenceDefinition(element.resequence[0]);
+ } else {
+ def.resequence = CamelDefinitionYamlStep.readResequenceDefinition(element.resequence);
+ }
+ }
+ if (element?.routingSlip !== undefined) {
+ if (Array.isArray(element.routingSlip)) {
+ def.routingSlip = CamelDefinitionYamlStep.readRoutingSlipDefinition(element.routingSlip[0]);
+ } else {
+ def.routingSlip = CamelDefinitionYamlStep.readRoutingSlipDefinition(element.routingSlip);
+ }
+ }
+ if (element?.transform !== undefined) {
+ if (Array.isArray(element.transform)) {
+ def.transform = CamelDefinitionYamlStep.readTransformDefinition(element.transform[0]);
+ } else {
+ def.transform = CamelDefinitionYamlStep.readTransformDefinition(element.transform);
+ }
+ }
+ if (element?.removeProperties !== undefined) {
+ if (Array.isArray(element.removeProperties)) {
+ def.removeProperties = CamelDefinitionYamlStep.readRemovePropertiesDefinition(element.removeProperties[0]);
+ } else {
+ 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]);
+ } else {
+ def.policy = CamelDefinitionYamlStep.readPolicyDefinition(element.policy);
+ }
+ }
+ if (element?.validate !== undefined) {
+ if (Array.isArray(element.validate)) {
+ def.validate = CamelDefinitionYamlStep.readValidateDefinition(element.validate[0]);
+ } else {
+ def.validate = CamelDefinitionYamlStep.readValidateDefinition(element.validate);
+ }
+ }
+ if (element?.rollback !== undefined) {
+ if (Array.isArray(element.rollback)) {
+ def.rollback = CamelDefinitionYamlStep.readRollbackDefinition(element.rollback[0]);
+ } else {
+ def.rollback = CamelDefinitionYamlStep.readRollbackDefinition(element.rollback);
+ }
+ }
+ if (element?.setHeaders !== undefined) {
+ if (Array.isArray(element.setHeaders)) {
+ def.setHeaders = CamelDefinitionYamlStep.readSetHeadersDefinition(element.setHeaders[0]);
+ } else {
+ def.setHeaders = CamelDefinitionYamlStep.readSetHeadersDefinition(element.setHeaders);
+ }
+ }
+ if (element?.process !== undefined) {
+ if (Array.isArray(element.process)) {
+ def.process = CamelDefinitionYamlStep.readProcessDefinition(element.process[0]);
+ } else {
+ def.process = CamelDefinitionYamlStep.readProcessDefinition(element.process);
+ }
+ }
+ if (element?.setVariables !== undefined) {
+ if (Array.isArray(element.setVariables)) {
+ def.setVariables = CamelDefinitionYamlStep.readSetVariablesDefinition(element.setVariables[0]);
+ } else {
+ def.setVariables = CamelDefinitionYamlStep.readSetVariablesDefinition(element.setVariables);
+ }
+ }
+ 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]);
+ } else {
+ def.threads = CamelDefinitionYamlStep.readThreadsDefinition(element.threads);
+ }
+ }
+ if (element?.setBody !== undefined) {
+ if (Array.isArray(element.setBody)) {
+ def.setBody = CamelDefinitionYamlStep.readSetBodyDefinition(element.setBody[0]);
+ } else {
+ def.setBody = CamelDefinitionYamlStep.readSetBodyDefinition(element.setBody);
+ }
+ }
+ if (element?.sample !== undefined) {
+ if (Array.isArray(element.sample)) {
+ def.sample = CamelDefinitionYamlStep.readSamplingDefinition(element.sample[0]);
+ } else {
+ def.sample = CamelDefinitionYamlStep.readSamplingDefinition(element.sample);
+ }
+ }
+ if (element?.throwException !== undefined) {
+ if (Array.isArray(element.throwException)) {
+ def.throwException = CamelDefinitionYamlStep.readThrowExceptionDefinition(element.throwException[0]);
+ } else {
+ def.throwException = CamelDefinitionYamlStep.readThrowExceptionDefinition(element.throwException);
+ }
+ }
+ if (element?.dynamicRouter !== undefined) {
+ if (Array.isArray(element.dynamicRouter)) {
+ def.dynamicRouter = CamelDefinitionYamlStep.readDynamicRouterDefinition(element.dynamicRouter[0]);
+ } else {
+ def.dynamicRouter = CamelDefinitionYamlStep.readDynamicRouterDefinition(element.dynamicRouter);
+ }
+ }
+ if (element?.multicast !== undefined) {
+ if (Array.isArray(element.multicast)) {
+ def.multicast = CamelDefinitionYamlStep.readMulticastDefinition(element.multicast[0]);
+ } else {
+ def.multicast = CamelDefinitionYamlStep.readMulticastDefinition(element.multicast);
+ }
+ }
+ if (element?.tokenizer !== undefined) {
+ if (Array.isArray(element.tokenizer)) {
+ def.tokenizer = CamelDefinitionYamlStep.readTokenizerDefinition(element.tokenizer[0]);
+ } else {
+ def.tokenizer = CamelDefinitionYamlStep.readTokenizerDefinition(element.tokenizer);
+ }
+ }
+ if (element?.filter !== undefined) {
+ if (Array.isArray(element.filter)) {
+ def.filter = CamelDefinitionYamlStep.readFilterDefinition(element.filter[0]);
+ } else {
+ def.filter = CamelDefinitionYamlStep.readFilterDefinition(element.filter);
+ }
+ }
+ if (element?.pipeline !== undefined) {
+ if (Array.isArray(element.pipeline)) {
+ def.pipeline = CamelDefinitionYamlStep.readPipelineDefinition(element.pipeline[0]);
+ } else {
+ def.pipeline = CamelDefinitionYamlStep.readPipelineDefinition(element.pipeline);
+ }
+ }
+ if (element?.unmarshal !== undefined) {
+ if (Array.isArray(element.unmarshal)) {
+ def.unmarshal = CamelDefinitionYamlStep.readUnmarshalDefinition(element.unmarshal[0]);
+ } else {
+ def.unmarshal = CamelDefinitionYamlStep.readUnmarshalDefinition(element.unmarshal);
+ }
+ }
+ if (element?.wireTap !== undefined) {
+ if (Array.isArray(element.wireTap)) {
+ def.wireTap = CamelDefinitionYamlStep.readWireTapDefinition(element.wireTap[0]);
+ } else {
+ def.wireTap = CamelDefinitionYamlStep.readWireTapDefinition(element.wireTap);
+ }
+ }
+ if (element?.step !== undefined) {
+ if (Array.isArray(element.step)) {
+ def.step = CamelDefinitionYamlStep.readStepDefinition(element.step[0]);
+ } else {
+ def.step = CamelDefinitionYamlStep.readStepDefinition(element.step);
+ }
+ }
+ if (element?.choice !== undefined) {
+ if (Array.isArray(element.choice)) {
+ def.choice = CamelDefinitionYamlStep.readChoiceDefinition(element.choice[0]);
+ } else {
+ def.choice = CamelDefinitionYamlStep.readChoiceDefinition(element.choice);
+ }
+ }
+
+ return def;
+ }
+
+ static readBeansDeserializer = (element: any): BeansDeserializer => {
+
+ let def = element ? new BeansDeserializer({...element}) : new BeansDeserializer();
+
+ return def;
+ }
+
+ static readDataFormatsDefinitionDeserializer = (element: any): DataFormatsDefinitionDeserializer => {
+
+ let def = element ? new DataFormatsDefinitionDeserializer({...element}) : new DataFormatsDefinitionDeserializer();
+
+ return def;
+ }
+
+ static readErrorHandlerDeserializer = (element: any): ErrorHandlerDeserializer => {
+
+ let def = element ? new ErrorHandlerDeserializer({...element}) : new ErrorHandlerDeserializer();
+ if (element?.deadLetterChannel !== undefined) {
+ if (Array.isArray(element.deadLetterChannel)) {
+ def.deadLetterChannel = CamelDefinitionYamlStep.readDeadLetterChannelDefinition(element.deadLetterChannel[0]);
+ } else {
+ def.deadLetterChannel = CamelDefinitionYamlStep.readDeadLetterChannelDefinition(element.deadLetterChannel);
+ }
+ }
+ if (element?.noErrorHandler !== undefined) {
+ if (Array.isArray(element.noErrorHandler)) {
+ def.noErrorHandler = CamelDefinitionYamlStep.readNoErrorHandlerDefinition(element.noErrorHandler[0]);
+ } else {
+ def.noErrorHandler = CamelDefinitionYamlStep.readNoErrorHandlerDefinition(element.noErrorHandler);
+ }
+ }
+ if (element?.jtaTransactionErrorHandler !== undefined) {
+ if (Array.isArray(element.jtaTransactionErrorHandler)) {
+ def.jtaTransactionErrorHandler = CamelDefinitionYamlStep.readJtaTransactionErrorHandlerDefinition(element.jtaTransactionErrorHandler[0]);
+ } else {
+ def.jtaTransactionErrorHandler = CamelDefinitionYamlStep.readJtaTransactionErrorHandlerDefinition(element.jtaTransactionErrorHandler);
+ }
+ }
+ if (element?.defaultErrorHandler !== undefined) {
+ if (Array.isArray(element.defaultErrorHandler)) {
+ def.defaultErrorHandler = CamelDefinitionYamlStep.readDefaultErrorHandlerDefinition(element.defaultErrorHandler[0]);
+ } else {
+ def.defaultErrorHandler = CamelDefinitionYamlStep.readDefaultErrorHandlerDefinition(element.defaultErrorHandler);
+ }
+ }
+ if (element?.springTransactionErrorHandler !== undefined) {
+ if (Array.isArray(element.springTransactionErrorHandler)) {
+ def.springTransactionErrorHandler = CamelDefinitionYamlStep.readSpringTransactionErrorHandlerDefinition(element.springTransactionErrorHandler[0]);
+ } else {
+ def.springTransactionErrorHandler = CamelDefinitionYamlStep.readSpringTransactionErrorHandlerDefinition(element.springTransactionErrorHandler);
+ }
+ }
+ if (element?.refErrorHandler !== undefined) {
+ if (Array.isArray(element.refErrorHandler)) {
+ def.refErrorHandler = CamelDefinitionYamlStep.readRefErrorHandlerDefinition(element.refErrorHandler[0]);
+ } else {
+ def.refErrorHandler = CamelDefinitionYamlStep.readRefErrorHandlerDefinition(element.refErrorHandler);
+ }
+ }
+
+ return def;
+ }
+
+ static readOutputAwareFromDefinition = (element: any): OutputAwareFromDefinition => {
+
+ let def = element ? new OutputAwareFromDefinition({...element}) : new OutputAwareFromDefinition();
+ def = ComponentApi.parseElementUri(def);
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readAggregateDefinition = (element: any): AggregateDefinition => {
+
+ let def = element ? new AggregateDefinition({...element}) : new AggregateDefinition();
+ if (element?.completionTimeoutExpression !== undefined) {
+ if (Array.isArray(element.completionTimeoutExpression)) {
+ def.completionTimeoutExpression = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.completionTimeoutExpression[0]);
+ } else {
+ def.completionTimeoutExpression = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.completionTimeoutExpression);
+ }
+ }
+ if (element?.correlationExpression !== undefined) {
+ if (Array.isArray(element.correlationExpression)) {
+ def.correlationExpression = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.correlationExpression[0]);
+ } else {
+ def.correlationExpression = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.correlationExpression);
+ }
+ }
+ if (element?.completionPredicate !== undefined) {
+ if (Array.isArray(element.completionPredicate)) {
+ def.completionPredicate = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.completionPredicate[0]);
+ } else {
+ def.completionPredicate = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.completionPredicate);
+ }
+ }
+ if (element?.optimisticLockRetryPolicy !== undefined) {
+ if (Array.isArray(element.optimisticLockRetryPolicy)) {
+ def.optimisticLockRetryPolicy = CamelDefinitionYamlStep.readOptimisticLockRetryPolicyDefinition(element.optimisticLockRetryPolicy[0]);
+ } else {
+ def.optimisticLockRetryPolicy = CamelDefinitionYamlStep.readOptimisticLockRetryPolicyDefinition(element.optimisticLockRetryPolicy);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+ if (element?.completionSizeExpression !== undefined) {
+ if (Array.isArray(element.completionSizeExpression)) {
+ def.completionSizeExpression = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.completionSizeExpression[0]);
+ } else {
+ def.completionSizeExpression = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.completionSizeExpression);
+ }
+ }
+
+ return def;
+ }
+
+ static readBeanDefinition = (element: any): BeanDefinition => {
+
+ let def = element ? new BeanDefinition({...element}) : new BeanDefinition();
+
+ return def;
+ }
+
+ static readBeanFactoryDefinition = (element: any): BeanFactoryDefinition => {
+
+ let def = element ? new BeanFactoryDefinition({...element}) : new BeanFactoryDefinition();
+
+ return def;
+ }
+
+ static readCatchDefinition = (element: any): CatchDefinition => {
+
+ let def = element ? new CatchDefinition({...element}) : new CatchDefinition();
+ if (element?.onWhen !== undefined) {
+ if (Array.isArray(element.onWhen)) {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen[0]);
+ } else {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readChoiceDefinition = (element: any): ChoiceDefinition => {
+
+ let def = element ? new ChoiceDefinition({...element}) : new ChoiceDefinition();
+ if (element?.otherwise !== undefined) {
+ if (Array.isArray(element.otherwise)) {
+ def.otherwise = CamelDefinitionYamlStep.readOtherwiseDefinition(element.otherwise[0]);
+ } else {
+ def.otherwise = CamelDefinitionYamlStep.readOtherwiseDefinition(element.otherwise);
+ }
+ }
+ def.when = element && element?.when ? element?.when.map((x:any) => CamelDefinitionYamlStep.readWhenDefinition(x)) :[];
+
+ return def;
+ }
+
+ static readCircuitBreakerDefinition = (element: any): CircuitBreakerDefinition => {
+
+ let def = element ? new CircuitBreakerDefinition({...element}) : new CircuitBreakerDefinition();
+ if (element?.faultToleranceConfiguration !== undefined) {
+ if (Array.isArray(element.faultToleranceConfiguration)) {
+ def.faultToleranceConfiguration = CamelDefinitionYamlStep.readFaultToleranceConfigurationDefinition(element.faultToleranceConfiguration[0]);
+ } else {
+ def.faultToleranceConfiguration = CamelDefinitionYamlStep.readFaultToleranceConfigurationDefinition(element.faultToleranceConfiguration);
+ }
+ }
+ if (element?.resilience4jConfiguration !== undefined) {
+ if (Array.isArray(element.resilience4jConfiguration)) {
+ def.resilience4jConfiguration = CamelDefinitionYamlStep.readResilience4jConfigurationDefinition(element.resilience4jConfiguration[0]);
+ } else {
+ def.resilience4jConfiguration = CamelDefinitionYamlStep.readResilience4jConfigurationDefinition(element.resilience4jConfiguration);
+ }
+ }
+ if (element?.onFallback !== undefined) {
+ if (Array.isArray(element.onFallback)) {
+ def.onFallback = CamelDefinitionYamlStep.readOnFallbackDefinition(element.onFallback[0]);
+ } else {
+ def.onFallback = CamelDefinitionYamlStep.readOnFallbackDefinition(element.onFallback);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readClaimCheckDefinition = (element: any): ClaimCheckDefinition => {
+
+ let def = element ? new ClaimCheckDefinition({...element}) : new ClaimCheckDefinition();
+
+ return def;
+ }
+
+ static readContextScanDefinition = (element: any): ContextScanDefinition => {
+
+ let def = element ? new ContextScanDefinition({...element}) : new ContextScanDefinition();
+
+ return def;
+ }
+
+ static readConvertBodyDefinition = (element: any): ConvertBodyDefinition => {
+ if (element && typeof element === 'string') element = {type: element};
+ let def = element ? new ConvertBodyDefinition({...element}) : new ConvertBodyDefinition();
+
+ return def;
+ }
+
+ static readConvertHeaderDefinition = (element: any): ConvertHeaderDefinition => {
+
+ let def = element ? new ConvertHeaderDefinition({...element}) : new ConvertHeaderDefinition();
+
+ 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();
+
+ return def;
+ }
+
+ static readDelayDefinition = (element: any): DelayDefinition => {
+
+ let def = element ? new DelayDefinition({...element}) : new DelayDefinition();
+ 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 readDynamicRouterDefinition = (element: any): DynamicRouterDefinition => {
+
+ let def = element ? new DynamicRouterDefinition({...element}) : new DynamicRouterDefinition();
+ 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 readEnrichDefinition = (element: any): EnrichDefinition => {
+
+ let def = element ? new EnrichDefinition({...element}) : new EnrichDefinition();
+ 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 readErrorHandlerDefinition = (element: any): ErrorHandlerDefinition => {
+
+ let def = element ? new ErrorHandlerDefinition({...element}) : new ErrorHandlerDefinition();
+ if (element?.deadLetterChannel !== undefined) {
+ if (Array.isArray(element.deadLetterChannel)) {
+ def.deadLetterChannel = CamelDefinitionYamlStep.readDeadLetterChannelDefinition(element.deadLetterChannel[0]);
+ } else {
+ def.deadLetterChannel = CamelDefinitionYamlStep.readDeadLetterChannelDefinition(element.deadLetterChannel);
+ }
+ }
+ if (element?.noErrorHandler !== undefined) {
+ if (Array.isArray(element.noErrorHandler)) {
+ def.noErrorHandler = CamelDefinitionYamlStep.readNoErrorHandlerDefinition(element.noErrorHandler[0]);
+ } else {
+ def.noErrorHandler = CamelDefinitionYamlStep.readNoErrorHandlerDefinition(element.noErrorHandler);
+ }
+ }
+ if (element?.jtaTransactionErrorHandler !== undefined) {
+ if (Array.isArray(element.jtaTransactionErrorHandler)) {
+ def.jtaTransactionErrorHandler = CamelDefinitionYamlStep.readJtaTransactionErrorHandlerDefinition(element.jtaTransactionErrorHandler[0]);
+ } else {
+ def.jtaTransactionErrorHandler = CamelDefinitionYamlStep.readJtaTransactionErrorHandlerDefinition(element.jtaTransactionErrorHandler);
+ }
+ }
+ if (element?.defaultErrorHandler !== undefined) {
+ if (Array.isArray(element.defaultErrorHandler)) {
+ def.defaultErrorHandler = CamelDefinitionYamlStep.readDefaultErrorHandlerDefinition(element.defaultErrorHandler[0]);
+ } else {
+ def.defaultErrorHandler = CamelDefinitionYamlStep.readDefaultErrorHandlerDefinition(element.defaultErrorHandler);
+ }
+ }
+ if (element?.springTransactionErrorHandler !== undefined) {
+ if (Array.isArray(element.springTransactionErrorHandler)) {
+ def.springTransactionErrorHandler = CamelDefinitionYamlStep.readSpringTransactionErrorHandlerDefinition(element.springTransactionErrorHandler[0]);
+ } else {
+ def.springTransactionErrorHandler = CamelDefinitionYamlStep.readSpringTransactionErrorHandlerDefinition(element.springTransactionErrorHandler);
+ }
+ }
+ if (element?.refErrorHandler !== undefined) {
+ if (Array.isArray(element.refErrorHandler)) {
+ def.refErrorHandler = CamelDefinitionYamlStep.readRefErrorHandlerDefinition(element.refErrorHandler[0]);
+ } else {
+ def.refErrorHandler = CamelDefinitionYamlStep.readRefErrorHandlerDefinition(element.refErrorHandler);
+ }
+ }
+
+ return def;
+ }
+
+ static readExpressionSubElementDefinition = (element: any): ExpressionSubElementDefinition => {
+
+ let def = element ? new ExpressionSubElementDefinition({...element}) : new ExpressionSubElementDefinition();
+ 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]);
+ } else {
+ 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]);
+ } else {
+ def.datasonnet = CamelDefinitionYamlStep.readDatasonnetExpression(element.datasonnet);
+ }
+ }
+ if (element?.jq !== undefined) {
+ if (Array.isArray(element.jq)) {
+ def.jq = CamelDefinitionYamlStep.readJqExpression(element.jq[0]);
+ } else {
+ def.jq = CamelDefinitionYamlStep.readJqExpression(element.jq);
+ }
+ }
+ if (element?.js !== undefined) {
+ if (Array.isArray(element.js)) {
+ def.js = CamelDefinitionYamlStep.readJavaScriptExpression(element.js[0]);
+ } else {
+ def.js = CamelDefinitionYamlStep.readJavaScriptExpression(element.js);
+ }
+ }
+ if (element?.language !== undefined) {
+ if (Array.isArray(element.language)) {
+ def.language = CamelDefinitionYamlStep.readLanguageExpression(element.language[0]);
+ } else {
+ def.language = CamelDefinitionYamlStep.readLanguageExpression(element.language);
+ }
+ }
+ if (element?.simple !== undefined) {
+ if (Array.isArray(element.simple)) {
+ def.simple = CamelDefinitionYamlStep.readSimpleExpression(element.simple[0]);
+ } else {
+ 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]);
+ } else {
+ 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]);
+ } else {
+ def.ref = CamelDefinitionYamlStep.readRefExpression(element.ref);
+ }
+ }
+ if (element?.xpath !== undefined) {
+ if (Array.isArray(element.xpath)) {
+ def.xpath = CamelDefinitionYamlStep.readXPathExpression(element.xpath[0]);
+ } else {
+ 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]);
+ } else {
+ 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]);
+ } else {
+ def.csimple = CamelDefinitionYamlStep.readCSimpleExpression(element.csimple);
+ }
+ }
+ if (element?.exchangeProperty !== undefined) {
+ if (Array.isArray(element.exchangeProperty)) {
+ def.exchangeProperty = CamelDefinitionYamlStep.readExchangePropertyExpression(element.exchangeProperty[0]);
+ } else {
+ def.exchangeProperty = CamelDefinitionYamlStep.readExchangePropertyExpression(element.exchangeProperty);
+ }
+ }
+ 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?.variable !== undefined) {
+ if (Array.isArray(element.variable)) {
+ def.variable = CamelDefinitionYamlStep.readVariableExpression(element.variable[0]);
+ } else {
+ def.variable = CamelDefinitionYamlStep.readVariableExpression(element.variable);
+ }
+ }
+ if (element?.header !== undefined) {
+ if (Array.isArray(element.header)) {
+ def.header = CamelDefinitionYamlStep.readHeaderExpression(element.header[0]);
+ } else {
+ def.header = CamelDefinitionYamlStep.readHeaderExpression(element.header);
+ }
+ }
+ if (element?.xtokenize !== undefined) {
+ if (Array.isArray(element.xtokenize)) {
+ def.xtokenize = CamelDefinitionYamlStep.readXMLTokenizerExpression(element.xtokenize[0]);
+ } else {
+ def.xtokenize = CamelDefinitionYamlStep.readXMLTokenizerExpression(element.xtokenize);
+ }
+ }
+
+ return def;
+ }
+
+ static readFaultToleranceConfigurationDefinition = (element: any): FaultToleranceConfigurationDefinition => {
+
+ let def = element ? new FaultToleranceConfigurationDefinition({...element}) : new FaultToleranceConfigurationDefinition();
+
+ return def;
+ }
+
+ static readFilterDefinition = (element: any): FilterDefinition => {
+
+ let def = element ? new FilterDefinition({...element}) : new FilterDefinition();
+ 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];
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readFinallyDefinition = (element: any): FinallyDefinition => {
+
+ let def = element ? new FinallyDefinition({...element}) : new FinallyDefinition();
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readFromDefinition = (element: any): FromDefinition => {
+ if (element && typeof element === 'string') element = { uri: element};
+ let def = element ? new FromDefinition({...element}) : new FromDefinition();
+ def = ComponentApi.parseElementUri(def);
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readGlobalOptionDefinition = (element: any): GlobalOptionDefinition => {
+
+ let def = element ? new GlobalOptionDefinition({...element}) : new GlobalOptionDefinition();
+
+ return def;
+ }
+
+ static readGlobalOptionsDefinition = (element: any): GlobalOptionsDefinition => {
+
+ let def = element ? new GlobalOptionsDefinition({...element}) : new GlobalOptionsDefinition();
+ def.globalOption = element && element?.globalOption ? element?.globalOption.map((x:any) => CamelDefinitionYamlStep.readGlobalOptionDefinition(x)) :[];
+
+ return def;
+ }
+
+ static readIdempotentConsumerDefinition = (element: any): IdempotentConsumerDefinition => {
+
+ let def = element ? new IdempotentConsumerDefinition({...element}) : new IdempotentConsumerDefinition();
+ 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];
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readInputTypeDefinition = (element: any): InputTypeDefinition => {
+
+ let def = element ? new InputTypeDefinition({...element}) : new InputTypeDefinition();
+
+ return def;
+ }
+
+ static readInterceptDefinition = (element: any): InterceptDefinition => {
+
+ let def = element ? new InterceptDefinition({...element}) : new InterceptDefinition();
+ if (element?.onWhen !== undefined) {
+ if (Array.isArray(element.onWhen)) {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen[0]);
+ } else {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readInterceptFromDefinition = (element: any): InterceptFromDefinition => {
+
+ let def = element ? new InterceptFromDefinition({...element}) : new InterceptFromDefinition();
+ def = ComponentApi.parseElementUri(def);
+ if (element?.onWhen !== undefined) {
+ if (Array.isArray(element.onWhen)) {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen[0]);
+ } else {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readInterceptSendToEndpointDefinition = (element: any): InterceptSendToEndpointDefinition => {
+ if (element && typeof element === 'string') element = {uri: element};
+ let def = element ? new InterceptSendToEndpointDefinition({...element}) : new InterceptSendToEndpointDefinition();
+ def = ComponentApi.parseElementUri(def);
+ if (element?.onWhen !== undefined) {
+ if (Array.isArray(element.onWhen)) {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen[0]);
+ } else {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readKameletDefinition = (element: any): KameletDefinition => {
+ if (element && typeof element === 'string') element = {name: element};
+ let def = element ? new KameletDefinition({...element}) : new KameletDefinition();
+
+ return def;
+ }
+
+ static readLoadBalanceDefinition = (element: any): LoadBalanceDefinition => {
+
+ let def = element ? new LoadBalanceDefinition({...element}) : new LoadBalanceDefinition();
+ if (element?.roundRobinLoadBalancer !== undefined) {
+ if (Array.isArray(element.roundRobinLoadBalancer)) {
+ def.roundRobinLoadBalancer = CamelDefinitionYamlStep.readRoundRobinLoadBalancerDefinition(element.roundRobinLoadBalancer[0]);
+ } else {
+ def.roundRobinLoadBalancer = CamelDefinitionYamlStep.readRoundRobinLoadBalancerDefinition(element.roundRobinLoadBalancer);
+ }
+ }
+ if (element?.stickyLoadBalancer !== undefined) {
+ if (Array.isArray(element.stickyLoadBalancer)) {
+ def.stickyLoadBalancer = CamelDefinitionYamlStep.readStickyLoadBalancerDefinition(element.stickyLoadBalancer[0]);
+ } else {
+ def.stickyLoadBalancer = CamelDefinitionYamlStep.readStickyLoadBalancerDefinition(element.stickyLoadBalancer);
+ }
+ }
+ if (element?.customLoadBalancer !== undefined) {
+ if (Array.isArray(element.customLoadBalancer)) {
+ def.customLoadBalancer = CamelDefinitionYamlStep.readCustomLoadBalancerDefinition(element.customLoadBalancer[0]);
+ } else {
+ def.customLoadBalancer = CamelDefinitionYamlStep.readCustomLoadBalancerDefinition(element.customLoadBalancer);
+ }
+ }
+ if (element?.topicLoadBalancer !== undefined) {
+ if (Array.isArray(element.topicLoadBalancer)) {
+ def.topicLoadBalancer = CamelDefinitionYamlStep.readTopicLoadBalancerDefinition(element.topicLoadBalancer[0]);
+ } else {
+ def.topicLoadBalancer = CamelDefinitionYamlStep.readTopicLoadBalancerDefinition(element.topicLoadBalancer);
+ }
+ }
+ if (element?.failoverLoadBalancer !== undefined) {
+ if (Array.isArray(element.failoverLoadBalancer)) {
+ def.failoverLoadBalancer = CamelDefinitionYamlStep.readFailoverLoadBalancerDefinition(element.failoverLoadBalancer[0]);
+ } else {
+ def.failoverLoadBalancer = CamelDefinitionYamlStep.readFailoverLoadBalancerDefinition(element.failoverLoadBalancer);
+ }
+ }
+ if (element?.weightedLoadBalancer !== undefined) {
+ if (Array.isArray(element.weightedLoadBalancer)) {
+ def.weightedLoadBalancer = CamelDefinitionYamlStep.readWeightedLoadBalancerDefinition(element.weightedLoadBalancer[0]);
+ } else {
+ def.weightedLoadBalancer = CamelDefinitionYamlStep.readWeightedLoadBalancerDefinition(element.weightedLoadBalancer);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+ if (element?.randomLoadBalancer !== undefined) {
+ if (Array.isArray(element.randomLoadBalancer)) {
+ def.randomLoadBalancer = CamelDefinitionYamlStep.readRandomLoadBalancerDefinition(element.randomLoadBalancer[0]);
+ } else {
+ def.randomLoadBalancer = CamelDefinitionYamlStep.readRandomLoadBalancerDefinition(element.randomLoadBalancer);
+ }
+ }
+
+ return def;
+ }
+
+ static readLogDefinition = (element: any): LogDefinition => {
+ if (element && typeof element === 'string') element = {message: element};
+ let def = element ? new LogDefinition({...element}) : new LogDefinition();
+
+ return def;
+ }
+
+ static readLoopDefinition = (element: any): LoopDefinition => {
+
+ let def = element ? new LoopDefinition({...element}) : new LoopDefinition();
+ 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];
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readMarshalDefinition = (element: any): MarshalDefinition => {
+
+ let def = element ? new MarshalDefinition({...element}) : new MarshalDefinition();
+ if (element?.univocityCsv !== undefined) {
+ if (Array.isArray(element.univocityCsv)) {
+ def.univocityCsv = CamelDefinitionYamlStep.readUniVocityCsvDataFormat(element.univocityCsv[0]);
+ } else {
+ def.univocityCsv = CamelDefinitionYamlStep.readUniVocityCsvDataFormat(element.univocityCsv);
+ }
+ }
+ if (element?.protobuf !== undefined) {
+ if (Array.isArray(element.protobuf)) {
+ def.protobuf = CamelDefinitionYamlStep.readProtobufDataFormat(element.protobuf[0]);
+ } else {
+ def.protobuf = CamelDefinitionYamlStep.readProtobufDataFormat(element.protobuf);
+ }
+ }
+ if (element?.tarFile !== undefined) {
+ if (Array.isArray(element.tarFile)) {
+ def.tarFile = CamelDefinitionYamlStep.readTarFileDataFormat(element.tarFile[0]);
+ } else {
+ def.tarFile = CamelDefinitionYamlStep.readTarFileDataFormat(element.tarFile);
+ }
+ }
+ if (element?.tidyMarkup !== undefined) {
+ if (Array.isArray(element.tidyMarkup)) {
+ def.tidyMarkup = CamelDefinitionYamlStep.readTidyMarkupDataFormat(element.tidyMarkup[0]);
+ } else {
+ def.tidyMarkup = CamelDefinitionYamlStep.readTidyMarkupDataFormat(element.tidyMarkup);
+ }
+ }
+ if (element?.csv !== undefined) {
+ if (Array.isArray(element.csv)) {
+ def.csv = CamelDefinitionYamlStep.readCsvDataFormat(element.csv[0]);
+ } else {
+ def.csv = CamelDefinitionYamlStep.readCsvDataFormat(element.csv);
+ }
+ }
+ if (element?.base64 !== undefined) {
+ if (Array.isArray(element.base64)) {
+ def.base64 = CamelDefinitionYamlStep.readBase64DataFormat(element.base64[0]);
+ } else {
+ def.base64 = CamelDefinitionYamlStep.readBase64DataFormat(element.base64);
+ }
+ }
+ if (element?.zipDeflater !== undefined) {
+ if (Array.isArray(element.zipDeflater)) {
+ def.zipDeflater = CamelDefinitionYamlStep.readZipDeflaterDataFormat(element.zipDeflater[0]);
+ } else {
+ def.zipDeflater = CamelDefinitionYamlStep.readZipDeflaterDataFormat(element.zipDeflater);
+ }
+ }
+ if (element?.bindy !== undefined) {
+ if (Array.isArray(element.bindy)) {
+ def.bindy = CamelDefinitionYamlStep.readBindyDataFormat(element.bindy[0]);
+ } else {
+ def.bindy = CamelDefinitionYamlStep.readBindyDataFormat(element.bindy);
+ }
+ }
+ if (element?.syslog !== undefined) {
+ if (Array.isArray(element.syslog)) {
+ def.syslog = CamelDefinitionYamlStep.readSyslogDataFormat(element.syslog[0]);
+ } else {
+ def.syslog = CamelDefinitionYamlStep.readSyslogDataFormat(element.syslog);
+ }
+ }
+ if (element?.zipFile !== undefined) {
+ if (Array.isArray(element.zipFile)) {
+ def.zipFile = CamelDefinitionYamlStep.readZipFileDataFormat(element.zipFile[0]);
+ } else {
+ def.zipFile = CamelDefinitionYamlStep.readZipFileDataFormat(element.zipFile);
+ }
+ }
+ if (element?.jaxb !== undefined) {
+ if (Array.isArray(element.jaxb)) {
+ def.jaxb = CamelDefinitionYamlStep.readJaxbDataFormat(element.jaxb[0]);
+ } else {
+ def.jaxb = CamelDefinitionYamlStep.readJaxbDataFormat(element.jaxb);
+ }
+ }
+ if (element?.parquetAvro !== undefined) {
+ if (Array.isArray(element.parquetAvro)) {
+ def.parquetAvro = CamelDefinitionYamlStep.readParquetAvroDataFormat(element.parquetAvro[0]);
+ } else {
+ def.parquetAvro = CamelDefinitionYamlStep.readParquetAvroDataFormat(element.parquetAvro);
+ }
+ }
+ if (element?.rss !== undefined) {
+ if (Array.isArray(element.rss)) {
+ def.rss = CamelDefinitionYamlStep.readRssDataFormat(element.rss[0]);
+ } else {
+ def.rss = CamelDefinitionYamlStep.readRssDataFormat(element.rss);
+ }
+ }
+ if (element?.smooks !== undefined) {
+ if (Array.isArray(element.smooks)) {
+ def.smooks = CamelDefinitionYamlStep.readSmooksDataFormat(element.smooks[0]);
+ } else {
+ def.smooks = CamelDefinitionYamlStep.readSmooksDataFormat(element.smooks);
+ }
+ }
+ if (element?.mimeMultipart !== undefined) {
+ if (Array.isArray(element.mimeMultipart)) {
+ def.mimeMultipart = CamelDefinitionYamlStep.readMimeMultipartDataFormat(element.mimeMultipart[0]);
+ } else {
+ def.mimeMultipart = CamelDefinitionYamlStep.readMimeMultipartDataFormat(element.mimeMultipart);
+ }
+ }
+ if (element?.asn1 !== undefined) {
+ if (Array.isArray(element.asn1)) {
+ def.asn1 = CamelDefinitionYamlStep.readASN1DataFormat(element.asn1[0]);
+ } else {
+ def.asn1 = CamelDefinitionYamlStep.readASN1DataFormat(element.asn1);
+ }
+ }
+ if (element?.pgp !== undefined) {
+ if (Array.isArray(element.pgp)) {
+ def.pgp = CamelDefinitionYamlStep.readPGPDataFormat(element.pgp[0]);
+ } else {
+ def.pgp = CamelDefinitionYamlStep.readPGPDataFormat(element.pgp);
+ }
+ }
+ if (element?.thrift !== undefined) {
+ if (Array.isArray(element.thrift)) {
+ def.thrift = CamelDefinitionYamlStep.readThriftDataFormat(element.thrift[0]);
+ } else {
+ def.thrift = CamelDefinitionYamlStep.readThriftDataFormat(element.thrift);
+ }
+ }
+ if (element?.json !== undefined) {
+ if (Array.isArray(element.json)) {
+ def.json = CamelDefinitionYamlStep.readJsonDataFormat(element.json[0]);
+ } else {
+ def.json = CamelDefinitionYamlStep.readJsonDataFormat(element.json);
+ }
+ }
+ if (element?.lzf !== undefined) {
+ if (Array.isArray(element.lzf)) {
+ def.lzf = CamelDefinitionYamlStep.readLZFDataFormat(element.lzf[0]);
+ } else {
+ def.lzf = CamelDefinitionYamlStep.readLZFDataFormat(element.lzf);
+ }
+ }
+ if (element?.fhirXml !== undefined) {
+ if (Array.isArray(element.fhirXml)) {
+ def.fhirXml = CamelDefinitionYamlStep.readFhirXmlDataFormat(element.fhirXml[0]);
+ } else {
+ def.fhirXml = CamelDefinitionYamlStep.readFhirXmlDataFormat(element.fhirXml);
+ }
+ }
+ if (element?.barcode !== undefined) {
+ if (Array.isArray(element.barcode)) {
+ def.barcode = CamelDefinitionYamlStep.readBarcodeDataFormat(element.barcode[0]);
+ } else {
+ def.barcode = CamelDefinitionYamlStep.readBarcodeDataFormat(element.barcode);
+ }
+ }
+ if (element?.avro !== undefined) {
+ if (Array.isArray(element.avro)) {
+ def.avro = CamelDefinitionYamlStep.readAvroDataFormat(element.avro[0]);
+ } else {
+ def.avro = CamelDefinitionYamlStep.readAvroDataFormat(element.avro);
+ }
+ }
+ if (element?.iso8583 !== undefined) {
+ if (Array.isArray(element.iso8583)) {
+ def.iso8583 = CamelDefinitionYamlStep.readIso8583DataFormat(element.iso8583[0]);
+ } else {
+ def.iso8583 = CamelDefinitionYamlStep.readIso8583DataFormat(element.iso8583);
+ }
+ }
+ if (element?.yaml !== undefined) {
+ if (Array.isArray(element.yaml)) {
+ def.yaml = CamelDefinitionYamlStep.readYAMLDataFormat(element.yaml[0]);
+ } else {
+ def.yaml = CamelDefinitionYamlStep.readYAMLDataFormat(element.yaml);
+ }
+ }
+ if (element?.fory !== undefined) {
+ if (Array.isArray(element.fory)) {
+ def.fory = CamelDefinitionYamlStep.readForyDataFormat(element.fory[0]);
+ } else {
+ def.fory = CamelDefinitionYamlStep.readForyDataFormat(element.fory);
+ }
+ }
+ 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?.dfdl !== undefined) {
+ if (Array.isArray(element.dfdl)) {
+ def.dfdl = CamelDefinitionYamlStep.readDfdlDataFormat(element.dfdl[0]);
+ } else {
+ def.dfdl = CamelDefinitionYamlStep.readDfdlDataFormat(element.dfdl);
+ }
+ }
+ if (element?.fhirJson !== undefined) {
+ if (Array.isArray(element.fhirJson)) {
+ def.fhirJson = CamelDefinitionYamlStep.readFhirJsonDataFormat(element.fhirJson[0]);
+ } else {
+ def.fhirJson = CamelDefinitionYamlStep.readFhirJsonDataFormat(element.fhirJson);
+ }
+ }
+ if (element?.custom !== undefined) {
+ if (Array.isArray(element.custom)) {
+ def.custom = CamelDefinitionYamlStep.readCustomDataFormat(element.custom[0]);
+ } else {
+ def.custom = CamelDefinitionYamlStep.readCustomDataFormat(element.custom);
+ }
+ }
+ if (element?.flatpack !== undefined) {
+ if (Array.isArray(element.flatpack)) {
+ def.flatpack = CamelDefinitionYamlStep.readFlatpackDataFormat(element.flatpack[0]);
+ } else {
+ def.flatpack = CamelDefinitionYamlStep.readFlatpackDataFormat(element.flatpack);
+ }
+ }
+ if (element?.swiftMx !== undefined) {
+ if (Array.isArray(element.swiftMx)) {
+ def.swiftMx = CamelDefinitionYamlStep.readSwiftMxDataFormat(element.swiftMx[0]);
+ } else {
+ def.swiftMx = CamelDefinitionYamlStep.readSwiftMxDataFormat(element.swiftMx);
+ }
+ }
+ if (element?.cbor !== undefined) {
+ if (Array.isArray(element.cbor)) {
+ def.cbor = CamelDefinitionYamlStep.readCBORDataFormat(element.cbor[0]);
+ } else {
+ def.cbor = CamelDefinitionYamlStep.readCBORDataFormat(element.cbor);
+ }
+ }
+ if (element?.crypto !== undefined) {
+ if (Array.isArray(element.crypto)) {
+ def.crypto = CamelDefinitionYamlStep.readCryptoDataFormat(element.crypto[0]);
+ } else {
+ def.crypto = CamelDefinitionYamlStep.readCryptoDataFormat(element.crypto);
+ }
+ }
+ if (element?.swiftMt !== undefined) {
+ if (Array.isArray(element.swiftMt)) {
+ def.swiftMt = CamelDefinitionYamlStep.readSwiftMtDataFormat(element.swiftMt[0]);
+ } else {
+ def.swiftMt = CamelDefinitionYamlStep.readSwiftMtDataFormat(element.swiftMt);
+ }
+ }
+ if (element?.univocityTsv !== undefined) {
+ if (Array.isArray(element.univocityTsv)) {
+ def.univocityTsv = CamelDefinitionYamlStep.readUniVocityTsvDataFormat(element.univocityTsv[0]);
+ } else {
+ def.univocityTsv = CamelDefinitionYamlStep.readUniVocityTsvDataFormat(element.univocityTsv);
+ }
+ }
+ if (element?.hl7 !== undefined) {
+ if (Array.isArray(element.hl7)) {
+ def.hl7 = CamelDefinitionYamlStep.readHL7DataFormat(element.hl7[0]);
+ } else {
+ def.hl7 = CamelDefinitionYamlStep.readHL7DataFormat(element.hl7);
+ }
+ }
+ if (element?.jsonApi !== undefined) {
+ if (Array.isArray(element.jsonApi)) {
+ def.jsonApi = CamelDefinitionYamlStep.readJsonApiDataFormat(element.jsonApi[0]);
+ } else {
+ def.jsonApi = CamelDefinitionYamlStep.readJsonApiDataFormat(element.jsonApi);
+ }
+ }
+ if (element?.xmlSecurity !== undefined) {
+ if (Array.isArray(element.xmlSecurity)) {
+ def.xmlSecurity = CamelDefinitionYamlStep.readXMLSecurityDataFormat(element.xmlSecurity[0]);
+ } else {
+ def.xmlSecurity = CamelDefinitionYamlStep.readXMLSecurityDataFormat(element.xmlSecurity);
+ }
+ }
+ if (element?.ical !== undefined) {
+ if (Array.isArray(element.ical)) {
+ def.ical = CamelDefinitionYamlStep.readIcalDataFormat(element.ical[0]);
+ } else {
+ def.ical = CamelDefinitionYamlStep.readIcalDataFormat(element.ical);
+ }
+ }
+ if (element?.univocityFixed !== undefined) {
+ if (Array.isArray(element.univocityFixed)) {
+ def.univocityFixed = CamelDefinitionYamlStep.readUniVocityFixedDataFormat(element.univocityFixed[0]);
+ } else {
+ def.univocityFixed = CamelDefinitionYamlStep.readUniVocityFixedDataFormat(element.univocityFixed);
+ }
+ }
+ if (element?.jacksonXml !== undefined) {
+ if (Array.isArray(element.jacksonXml)) {
+ def.jacksonXml = CamelDefinitionYamlStep.readJacksonXMLDataFormat(element.jacksonXml[0]);
+ } else {
+ def.jacksonXml = CamelDefinitionYamlStep.readJacksonXMLDataFormat(element.jacksonXml);
+ }
+ }
+ if (element?.grok !== undefined) {
+ if (Array.isArray(element.grok)) {
+ def.grok = CamelDefinitionYamlStep.readGrokDataFormat(element.grok[0]);
+ } else {
+ def.grok = CamelDefinitionYamlStep.readGrokDataFormat(element.grok);
+ }
+ }
+ if (element?.gzipDeflater !== undefined) {
+ if (Array.isArray(element.gzipDeflater)) {
+ def.gzipDeflater = CamelDefinitionYamlStep.readGzipDeflaterDataFormat(element.gzipDeflater[0]);
+ } else {
+ def.gzipDeflater = CamelDefinitionYamlStep.readGzipDeflaterDataFormat(element.gzipDeflater);
+ }
+ }
+ if (element?.soap !== undefined) {
+ if (Array.isArray(element.soap)) {
+ def.soap = CamelDefinitionYamlStep.readSoapDataFormat(element.soap[0]);
+ } else {
+ def.soap = CamelDefinitionYamlStep.readSoapDataFormat(element.soap);
+ }
+ }
+
+ return def;
+ }
+
+ static readMulticastDefinition = (element: any): MulticastDefinition => {
+
+ let def = element ? new MulticastDefinition({...element}) : new MulticastDefinition();
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readOnCompletionDefinition = (element: any): OnCompletionDefinition => {
+
+ let def = element ? new OnCompletionDefinition({...element}) : new OnCompletionDefinition();
+ if (element?.onWhen !== undefined) {
+ if (Array.isArray(element.onWhen)) {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen[0]);
+ } else {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readOnExceptionDefinition = (element: any): OnExceptionDefinition => {
+
+ let def = element ? new OnExceptionDefinition({...element}) : new OnExceptionDefinition();
+ if (element?.retryWhile !== undefined) {
+ if (Array.isArray(element.retryWhile)) {
+ def.retryWhile = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.retryWhile[0]);
+ } else {
+ def.retryWhile = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.retryWhile);
+ }
+ }
+ if (element?.redeliveryPolicy !== undefined) {
+ if (Array.isArray(element.redeliveryPolicy)) {
+ def.redeliveryPolicy = CamelDefinitionYamlStep.readRedeliveryPolicyDefinition(element.redeliveryPolicy[0]);
+ } else {
+ def.redeliveryPolicy = CamelDefinitionYamlStep.readRedeliveryPolicyDefinition(element.redeliveryPolicy);
+ }
+ }
+ if (element?.handled !== undefined) {
+ if (Array.isArray(element.handled)) {
+ def.handled = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.handled[0]);
+ } else {
+ def.handled = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.handled);
+ }
+ }
+ if (element?.onWhen !== undefined) {
+ if (Array.isArray(element.onWhen)) {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen[0]);
+ } else {
+ def.onWhen = CamelDefinitionYamlStep.readOnWhenDefinition(element.onWhen);
+ }
+ }
+ if (element?.continued !== undefined) {
+ if (Array.isArray(element.continued)) {
+ def.continued = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.continued[0]);
+ } else {
+ def.continued = CamelDefinitionYamlStep.readExpressionSubElementDefinition(element.continued);
+ }
+ }
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readOnFallbackDefinition = (element: any): OnFallbackDefinition => {
+
+ let def = element ? new OnFallbackDefinition({...element}) : new OnFallbackDefinition();
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readOnWhenDefinition = (element: any): OnWhenDefinition => {
+
+ let def = element ? new OnWhenDefinition({...element}) : new OnWhenDefinition();
+ 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 readOptimisticLockRetryPolicyDefinition = (element: any): OptimisticLockRetryPolicyDefinition => {
+
+ let def = element ? new OptimisticLockRetryPolicyDefinition({...element}) : new OptimisticLockRetryPolicyDefinition();
+
+ return def;
+ }
+
+ static readOtherwiseDefinition = (element: any): OtherwiseDefinition => {
+
+ let def = element ? new OtherwiseDefinition({...element}) : new OtherwiseDefinition();
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readOutputDefinition = (element: any): OutputDefinition => {
+
+ let def = element ? new OutputDefinition({...element}) : new OutputDefinition();
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readOutputTypeDefinition = (element: any): OutputTypeDefinition => {
+
+ let def = element ? new OutputTypeDefinition({...element}) : new OutputTypeDefinition();
+
+ return def;
+ }
+
+ static readPackageScanDefinition = (element: any): PackageScanDefinition => {
+
+ let def = element ? new PackageScanDefinition({...element}) : new PackageScanDefinition();
+
+ return def;
+ }
+
+ static readPausableDefinition = (element: any): PausableDefinition => {
+
+ let def = element ? new PausableDefinition({...element}) : new PausableDefinition();
+
+ return def;
+ }
+
+ static readPipelineDefinition = (element: any): PipelineDefinition => {
+
+ let def = element ? new PipelineDefinition({...element}) : new PipelineDefinition();
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readPolicyDefinition = (element: any): PolicyDefinition => {
+
+ let def = element ? new PolicyDefinition({...element}) : new PolicyDefinition();
+ def.steps = CamelDefinitionYamlStep.readSteps(element?.steps);
+
+ return def;
+ }
+
+ static readPollDefinition = (element: any): PollDefinition => {
+ if (element && typeof element === 'string') element = {uri: element};
+ let def = element ? new PollDefinition({...element}) : new PollDefinition();
+ def = ComponentApi.parseElementUri(def);
+
+ return def;
+ }
+
+ static readPollEnrichDefinition = (element: any): PollEnrichDefinition => {
+
+ let def = element ? new PollEnrichDefinition({...element}) : new PollEnrichDefinition();
+ 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 readProcessDefinition = (element: any): ProcessDefinition => {
+
+ let def = element ? new ProcessDefinition({...element}) : new ProcessDefinition();
+
+ return def;
+ }
+
+ static readPropertyDefinition = (element: any): PropertyDefinition => {
+
+ let def = element ? new PropertyDefinition({...element}) : new PropertyDefinition();
+
+ return def;
+ }
+
+ static readPropertyExpressionDefinition = (element: any): PropertyExpressionDefinition => {
+
+ let def = element ? new PropertyExpressionDefinition({...element}) : new PropertyExpressionDefinition();
+ 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 readRecipientListDefinition = (element: any): RecipientListDefinition => {
+
+ let def = element ? new RecipientListDefinition({...element}) : new RecipientListDefinition();
+ 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);
... 23227 lines suppressed ...