33 |
34 |
35 |
36 | )
37 | }
38 |
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/designer/property/property/BeanProperties.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .properties .bean-properties .pf-v5-c-form__group-control {
19 | display: flex;
20 | flex-direction: column;
21 | gap: 6px;
22 | }
23 |
24 | .karavan .properties .bean-property {
25 | display: flex;
26 | flex-direction: row;
27 | gap: 3px;
28 | }
29 |
30 | .karavan .properties .bean-property .argument-name,
31 | .karavan .properties .bean-property .field-name {
32 | flex: 1;
33 | }
34 |
35 | .karavan .properties .bean-property .field-value {
36 | flex: 2;
37 | }
38 | .karavan .properties .bean-property .argument-value {
39 | flex: 4;
40 | }
41 |
42 | .karavan .properties .bean-property .delete-button {
43 | padding: 3px;
44 | color: #b1b1b7;
45 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/designer/property/property/PropertyPlaceholderDropdown.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .properties .property-placeholder-toggle {
19 | padding-left: 6px;
20 | padding-right: 6px;
21 | }
22 |
23 | .karavan .properties .property-placeholder-toggle .pf-v5-c-button__icon.pf-m-start {
24 | margin-inline-end: 0;
25 | }
26 |
27 | .karavan .properties .property-placeholder-toggle .pf-v5-c-menu-toggle__controls {
28 | display: none;
29 | }
30 |
31 | .karavan .properties .property-placeholder-dropdown .pf-v5-c-menu__group-title {
32 | font-weight: bold;
33 | font-size: 13px;
34 | }
35 |
36 | .pf-v5-c-popover .property-placeholder-toggle-form {
37 | width: 300px;
38 | }
39 |
40 | .pf-v5-c-popover .property-placeholder-toggle-form .pf-v5-c-form__group {
41 | grid-template-columns: 1fr 2fr;
42 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/designer/property/property/VariablesDropdown.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .properties .variables-toggle {
19 | padding-left: 6px;
20 | padding-right: 6px;
21 | }
22 |
23 | .karavan .properties .variables-toggle .pf-v5-c-button__icon.pf-m-start {
24 | margin-inline-end: 0;
25 | }
26 |
27 | .karavan .properties .variables-toggle .pf-v5-c-menu-toggle__controls {
28 | display: none;
29 | }
30 |
31 | .pf-v5-c-popover .variables-toggle-form {
32 | width: 300px;
33 | }
34 |
35 | .pf-v5-c-popover .variables-toggle-form .pf-v5-c-form__group {
36 | grid-template-columns: 1fr 2fr;
37 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/designer/route/useResizeObserver.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import { useLayoutEffect, useRef } from 'react';
19 |
20 | function useResizeObserver(callback: (target: T, entry: ResizeObserverEntry) => void) {
21 | const ref = useRef(null)
22 |
23 | useLayoutEffect(() => {
24 | const element = ref?.current;
25 | if (!element) {
26 | return;
27 | }
28 | const observer1 = new ResizeObserver((entries) => {
29 | callback(element, entries[0]);
30 | });
31 | observer1.observe(element);
32 | return () => {
33 | observer1.disconnect();
34 | };
35 | }, [callback, ref]);
36 |
37 | return ref
38 | }
39 |
40 | export default useResizeObserver;
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/designer/utils/ElementIcon.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 |
19 | .add-button-icon, .insert-button-icon {
20 | fill: var(--pf-v5-global--primary-color--100);
21 | width: 20px;
22 | height: 20px;
23 | background: transparent;
24 | vertical-align: text-bottom;
25 | }
26 |
27 | .copy-button-icon {
28 | width: 20px;
29 | height: 20px;
30 | background: transparent;
31 | vertical-align: text-bottom;
32 | }
33 |
34 | .delete-button-icon {
35 | fill: var(--pf-v5-global--danger-color--100);
36 | width: 20px;
37 | height: 20px;
38 | background: transparent;
39 | vertical-align: text-bottom;
40 | }
41 |
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import React from 'react';
19 | import ReactDOM from 'react-dom/client';
20 | import "@patternfly/patternfly/patternfly.css";
21 | import './index.css';
22 | import {Main} from "./main/Main";
23 | import {BrowserRouter} from "react-router-dom";
24 |
25 | ReactDOM.createRoot(document.getElementById("root")!).render(
26 |
27 |
28 |
29 |
30 |
31 | );
32 |
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/project/DevModeToolbar.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .refresher {
19 | width: 34px;
20 | height: 34px;
21 | }
22 |
23 | .karavan .refresher .spinner {
24 | position: absolute;
25 | width: 34px;
26 | height: 34px;
27 | }
28 |
29 | .karavan .refresher .button {
30 | position: absolute;
31 | width: 34px;
32 | height: 34px;
33 | padding: 0;
34 | font-size: 16px;
35 | }
36 |
37 | .karavan .refresher .button .pf-v5-c-button__icon {
38 | margin: 0;
39 | }
40 |
41 | .karavan .toolbar .dev-action-button-place {
42 | --pf-v5-l-flex--spacer: 12px;
43 | }
44 |
45 | .karavan .toolbar .dev-action-button-place:last-child {
46 | --pf-v5-l-flex--spacer: 0;
47 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/project/beans/BeanFilesDropdown.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .bean-wizard .bean-wizard-toggle {
19 | padding-left: 6px;
20 | padding-right: 6px;
21 | }
22 |
23 | .bean-wizard .bean-wizard-toggle .pf-v5-c-button__icon.pf-m-start {
24 | margin-inline-end: 0;
25 | }
26 |
27 | .bean-wizard .bean-wizard-toggle .pf-v5-c-menu-toggle__controls {
28 | display: none;
29 | }
30 |
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/project/devmode.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .refresher {
19 | width: 34px;
20 | height: 34px;
21 | }
22 |
23 | .karavan .refresher .spinner {
24 | position: absolute;
25 | width: 34px;
26 | height: 34px;
27 | }
28 |
29 | .karavan .refresher .button {
30 | position: absolute;
31 | width: 34px;
32 | height: 34px;
33 | padding: 0;
34 | font-size: 16px;
35 | }
36 |
37 | .karavan .refresher .button .pf-v5-c-button__icon {
38 | margin: 0;
39 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/project/files/DiffFileModal.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan-diff-modal {
19 | height: 90%;
20 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/project/package/Package.css:
--------------------------------------------------------------------------------
1 | .karavan .project-page .project-package .toolbar {
2 | display: flex;
3 | gap: 12px;
4 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/project/trace/trace.css:
--------------------------------------------------------------------------------
1 | .trace-modal {
2 | height: 90%;
3 | }
4 |
5 | .trace-no-padding {
6 | padding: 0;
7 | }
8 |
9 | .trace-padding-bottom-only {
10 | padding: 0 0 var(--pf-v5-c-panel__header--PaddingBottom) 0;
11 | }
12 |
13 | .trace-modal .pf-v5-c-modal-box__body {
14 | display: flex;
15 | }
16 |
17 | .trace-modal .container {
18 | display: flex;
19 | flex-direction: row;
20 | padding: 0;
21 | flex: 1;
22 | }
23 |
24 | .trace-modal .panel1 {
25 | flex: 1;
26 | padding: 10px;
27 | }
28 |
29 | .trace-modal .panel1 .scrollable,
30 | .trace-modal .panel2 .scrollable {
31 | overflow-y: auto;
32 | height: 95%;
33 | padding-top: 10px;
34 | }
35 |
36 | .trace-modal .panel2 {
37 | flex: 4;
38 | padding: 10px;
39 | }
40 |
41 | /*.trace-modal .panel2 .pf-v5-c-tab-content {*/
42 | /* overflow-y: auto;*/
43 | /* height: 100%;*/
44 | /*}*/
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/topology/CustomGroup.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import * as React from 'react';
19 |
20 | import './topology.css';
21 | import {DefaultGroup, LabelPosition, observer} from '@patternfly/react-topology';
22 |
23 | const CustomGroup: React.FC = observer(({ element, ...rest }) => {
24 | return (
25 |
32 |
33 | )
34 | })
35 | export default CustomGroup;
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/topology/TopologyBeans.css:
--------------------------------------------------------------------------------
1 | .karavan .topology-panel .topology-beans-card {
2 | position: absolute;
3 | top: 6px;
4 | right: 6px;
5 | }
6 |
7 | .karavan .topology-panel .topology-beans-card .pf-v5-c-card__title {
8 | padding: 5px;
9 | display: flex;
10 | justify-content: center;
11 | }
12 |
13 | .karavan .topology-panel .topology-beans-card .card-body {
14 | display: flex;
15 | flex-direction: column;
16 | gap: 5px;
17 | padding: 0 10px 10px 10px;
18 | }
19 |
20 | .karavan .topology-panel .topology-beans-card .pf-v5-c-label {
21 | background-color: white;
22 | }
23 |
24 | .karavan .topology-panel .topology-beans-card .pf-v5-c-label__content::before {
25 | border-radius: 4px;
26 | }
27 | .karavan .topology-panel .topology-beans-card .bean-button {
28 | padding: 0;
29 | display: flex;
30 | }
31 |
32 | .karavan .topology-panel .topology-beans-card .pf-v5-c-badge {
33 | min-width: 32px;
34 | font-weight: normal;
35 | }
36 |
37 | .karavan .topology-panel .topology-beans-card .pf-v5-c-label__icon {
38 | height: unset;
39 | }
40 |
41 | .karavan .topology-panel .topology-beans-card .bean-button .pf-v5-c-button__icon {
42 | margin-top: auto;
43 | margin-bottom: auto;
44 | height: 16px;
45 | width: 16px;
46 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/topology/TopologyLegend.css:
--------------------------------------------------------------------------------
1 | .karavan .topology-panel .topology-legend-card {
2 | position: absolute;
3 | bottom: 6px;
4 | right: 6px;
5 | display: flex;
6 | flex-direction: row;
7 | align-items: center;
8 | }
9 |
10 | .karavan .topology-panel .topology-legend-card .pf-v5-c-card__title {
11 | padding: 5px;
12 | display: flex;
13 | justify-content: center;
14 | }
15 |
16 | .karavan .topology-panel .topology-legend-card .card-body {
17 | display: flex;
18 | flex-direction: row;
19 | gap: 5px;
20 | padding: 10px 10px 10px 10px;
21 | }
22 |
23 | .karavan .topology-panel .topology-legend-card .pf-v5-c-label {
24 | background-color: white;
25 | /*border-color: #ef9234;*/
26 | }
27 | .karavan .topology-panel .topology-legend-card .orange .pf-v5-c-label__content::before {
28 | border-color: #ef9234;
29 | }
30 |
31 | .karavan .topology-panel .topology-legend-card .route-template .pf-v5-c-label__content::before {
32 | border-style: dashed;
33 | }
34 |
35 | .karavan .topology-panel .topology-legend-card .blue .pf-v5-c-label__content::before {
36 | border-color: #2b9af3;
37 | }
38 |
39 | .karavan .topology-panel .topology-legend-card .green .pf-v5-c-label__content::before {
40 | border-color: #6ec664;
41 | }
42 |
43 | .karavan .topology-panel .topology-legend-card .pf-v5-c-label__content::before {
44 | border-radius: 4px;
45 | }
46 |
47 | .karavan .topology-panel .topology-legend-card .pf-v5-c-badge {
48 | min-width: 32px;
49 | font-weight: normal;
50 | }
51 |
52 | .karavan .topology-panel .topology-legend-card .pf-v5-c-label__icon {
53 | height: unset;
54 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/src/util/form-util.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .pf-v5-c-modal-box .text-field-with-prefix {
19 | gap: 0;
20 | }
21 |
22 | .pf-v5-c-modal-box .text-field-with-prefix .text-field-prefix {
23 | margin-top: auto;
24 | margin-bottom: auto;
25 | }
26 |
27 | .pf-v5-c-modal-box .text-field-with-prefix .pf-v5-c-text-input-group__text-input {
28 | padding-left: 0;
29 | }
30 |
31 | .pf-v5-c-modal-box .text-field-with-suffix .text-field-suffix {
32 | margin-top: auto;
33 | margin-bottom: auto;
34 | padding-left: 3px;
35 | padding-right: 3px;
36 | }
37 |
38 | .form-util-text-field {
39 | width: 100%;
40 | }
41 | .form-util-text-field-suffix,
42 | .form-util-text-field-suffix input {
43 | width: 150px
44 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": false,
6 | "skipLibCheck": true,
7 | "esModuleInterop": true,
8 | "allowSyntheticDefaultImports": true,
9 | "strict": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "noEmit": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "jsx": "react-jsx",
18 | "types": ["vite/client", "vite-plugin-svgr/client"]
19 | },
20 | "include": ["src", "**.mjs", "*.ts"]
21 | }
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/karavan-app/src/main/webui/vite.config.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import { defineConfig } from 'vite'
19 | import react from '@vitejs/plugin-react'
20 | import viteTsconfigPaths from 'vite-tsconfig-paths'
21 |
22 | // https://vitejs.dev/config/
23 | export default defineConfig({
24 | base: '/',
25 | plugins: [react(), viteTsconfigPaths()],
26 | server: {
27 | // this ensures that the browser opens upon server start
28 | open: true,
29 | // this sets a default port to 3000, you can change this
30 | port: 3003,
31 | }
32 | })
--------------------------------------------------------------------------------
/karavan-core/.mocharc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extension": ["ts"],
3 | "package": "./package.json",
4 | "spec": ["./test/**/*.spec.ts"],
5 | "node-option": [
6 | "experimental-specifier-resolution=node",
7 | "loader=ts-node/esm"
8 | ],
9 | "require": "ts-node/register",
10 | "loader": "ts-node/esm"
11 | }
12 |
--------------------------------------------------------------------------------
/karavan-core/.prettierignore:
--------------------------------------------------------------------------------
1 | **/CamelDefinitionApi.ts
2 | **/CamelDefinitionYamlStep.ts
3 | **/CamelDefinition.ts
4 | **/CamelMetadata.ts
5 | **/test
6 | .prettierrc
7 | package-lock.json
8 | package.json
9 | tsconfig.json
10 |
--------------------------------------------------------------------------------
/karavan-core/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "trailingComma": "all",
3 | "tabWidth": 4,
4 | "useTabs": false,
5 | "semi": true,
6 | "singleQuote": true,
7 | "jsxSingleQuote": true,
8 | "proseWrap": "never",
9 | "bracketSameLine": true,
10 | "arrowParens": "avoid",
11 | "printWidth": 120,
12 | "bracketSpacing": true,
13 | "singleAttributePerLine": false
14 | }
15 |
--------------------------------------------------------------------------------
/karavan-core/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "karavan-core",
3 | "publisher": "camel-karavan",
4 | "version": "4.10.2",
5 | "description": "Apache Camel Karavan Core",
6 | "scripts": {
7 | "build": "tsc && tsc-alias",
8 | "test": "cross-env TS_NODE_PROJECT=\"test/tsconfig.testing.json\" mocha --config=\".mocharc.json\"",
9 | "prepare": "npm run build && npm run test",
10 | "prepublishOnly": "npm run test"
11 | },
12 | "repository": {
13 | "type": "git",
14 | "url": "https://github.com/apache/camel-karavan.git"
15 | },
16 | "type": "module",
17 | "keywords": [
18 | "Camel",
19 | "Tool",
20 | "Integration",
21 | "Camel Yaml"
22 | ],
23 | "author": {
24 | "name": "Marat Gubaidullin",
25 | "email": "marat.gubaidullin@gmail.com"
26 | },
27 | "maintainers": [
28 | {
29 | "name": "Marat Gubaidullin",
30 | "email": "marat.gubaidullin@gmail.com"
31 | }
32 | ],
33 | "license": "Apache-2.0",
34 | "bugs": {
35 | "url": "https://github.com/apache/camel-karavan/issues"
36 | },
37 | "homepage": "https://github.com/apache/camel-karavan#readme",
38 | "dependencies": {
39 | "@types/js-yaml": "^4.0.9",
40 | "@types/uuid": "^10.0.0",
41 | "tsconfig-paths": "^4.2.0",
42 | "uuid": "10.0.0"
43 | },
44 | "devDependencies": {
45 | "@types/chai": "^5.0.1",
46 | "@types/dagre": "^0.7.52",
47 | "@types/mocha": "^10.0.10",
48 | "@types/node": "20.14.15",
49 | "typescript": "4.9.5",
50 | "chai": "^5.1.2",
51 | "cross-env": "^7.0.3",
52 | "fs": "^0.0.1-security",
53 | "mocha": "^11.1.0",
54 | "ts-node": "^10.9.2",
55 | "tsc-alias": "^1.8.10"
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/karavan-core/src/core/model/MainConfigurationModel.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | export class ApplicationProperty {
19 | name: string = '';
20 | value?: string;
21 | defaultValue?: string;
22 | description?: string;
23 | type?: string;
24 |
25 | public constructor(init?: Partial) {
26 | Object.assign(this, init);
27 | }
28 | }
29 |
30 | export class ApplicationPropertyGroup {
31 | name: string = '';
32 | description?: string;
33 |
34 | public constructor(init?: Partial) {
35 | Object.assign(this, init);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/karavan-core/src/core/model/ProjectModel.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import { v4 as uuidv4 } from 'uuid';
18 |
19 | export class ProjectProperty {
20 | id: string = '';
21 | key: string = '';
22 | value: any;
23 |
24 | public constructor(init?: Partial) {
25 | Object.assign(this, init);
26 | }
27 |
28 | static createNew(key: string, value: any): ProjectProperty {
29 | return new ProjectProperty({ id: uuidv4(), key: key, value: value });
30 | }
31 | }
32 |
33 | export class ProjectModel {
34 | properties: ProjectProperty[] = [];
35 |
36 | public constructor(init?: Partial) {
37 | Object.assign(this, init);
38 | }
39 |
40 | static createNew(init?: Partial): ProjectModel {
41 | return new ProjectModel(init ? init : {});
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/karavan-core/test/addStep1.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: camel.apache.org/v1
2 | kind: Integration
3 | metadata:
4 | name: ''
5 | spec:
6 | flows:
7 | - from:
8 | uri: kamelet:http-secured-source
9 | steps:
10 | - do-try:
11 | steps:
12 | - to: "log:when-a"
13 | - to: "log:when-b"
14 | do-catch:
15 | - exception:
16 | - "java.io.FileNotFoundException"
17 | - "java.io.IOException"
18 | onWhen:
19 | simple: "${body.size()} == 1"
20 | steps:
21 | - to: "log:io-error"
22 | - choice:
23 | when:
24 | - expression: {}
25 | steps:
26 | - tod: {}
27 | otherwise: {}
--------------------------------------------------------------------------------
/karavan-core/test/allowableValues.camel.yaml:
--------------------------------------------------------------------------------
1 | - rest:
2 | id: rest-b536
3 | get:
4 | - id: metadata
5 | path: /metadata
6 | to: direct:metadata
7 | param:
8 | - description: Requests the server to return a designated subset of the resource
9 | name: _summary
10 | type: query
11 | required: false
12 | collectionFormat: multi
13 | dataType: string
14 | allowableValues:
15 | - "true"
16 | - text
17 | - data
18 | - count
19 | - "false"
20 |
--------------------------------------------------------------------------------
/karavan-core/test/allowableValues.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import {expect} from 'chai';
18 | import 'mocha';
19 | import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml";
20 | import * as fs from 'fs';
21 |
22 | describe('Array of string', () => {
23 |
24 | it('Array of string', () => {
25 | const yaml = fs.readFileSync('test/allowableValues.camel.yaml', { encoding: 'utf8', flag: 'r' });
26 | const i = CamelDefinitionYaml.yamlToIntegration('allowableValues.camel.yaml', yaml);
27 | const yaml2 = CamelDefinitionYaml.integrationToYaml(i);
28 | expect(yaml2).to.equal(yaml);
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/karavan-core/test/beans1.yaml:
--------------------------------------------------------------------------------
1 | - beans:
2 | - name: myNested
3 | type: ${MyBean.class.name}
4 | properties:
5 | field1: 'value1'
6 | field2: 'value2'
7 | nested:
8 | foo: 'valueFoo'
9 | bar: 'valueBar'
10 | - name: myProps
11 | type: ${MyBean.class.name}
12 | properties:
13 | field1: 'f1_p'
14 | field2: 'f2_p'
15 | nested.foo: 'nf1_p'
16 | nested.bar: 'nf2_p'
17 | - from:
18 | uri: "direct:route"
19 | steps:
20 | - aggregate:
21 | strategy-ref: "myAggregatorStrategy"
22 | completion-size: 2
23 | correlation-expression:
24 | simple: "${header.StockSymbol}"
25 | steps:
26 | - to: "mock:route"
27 | - from:
28 | uri: "direct:route"
29 | steps:
30 | - aggregate:
31 | strategy-ref: "myAggregatorStrategy"
32 | completion-size: 2
33 | correlation-expression:
34 | simple: "${header.StockSymbol}"
35 | steps:
36 | - to: "mock:route"
--------------------------------------------------------------------------------
/karavan-core/test/beans2.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: camel.apache.org/v1
2 | kind: Integration
3 | metadata:
4 | name: Beans
5 | spec:
6 | flows:
7 | - beans:
8 | - name: myNested
9 | type: ${MyBean.class.name}
10 | properties:
11 | field1: 'value1'
12 | field2: 'value2'
13 | nested:
14 | foo: 'valueFoo'
15 | bar: 'valueBar'
16 | - name: myProps
17 | type: ${MyBean.class.name}
18 | properties:
19 | field1: 'f1_p'
20 | field2: 'f2_p'
21 | nested.foo: 'nf1_p'
22 | nested.bar: 'nf2_p'
23 | - from:
24 | uri: "direct:route"
25 | steps:
26 | - aggregate:
27 | strategy-ref: "myAggregatorStrategy"
28 | completion-size: 2
29 | correlation-expression:
30 | simple: "${header.StockSymbol}"
31 | steps:
32 | - to: "mock:route"
33 | - from:
34 | uri: "direct:route"
35 | steps:
36 | - aggregate:
37 | strategy-ref: "myAggregatorStrategy"
38 | completion-size: 2
39 | correlation-expression:
40 | simple: "${header.StockSymbol}"
41 | steps:
42 | - to: "mock:route"
--------------------------------------------------------------------------------
/karavan-core/test/beans3.yaml:
--------------------------------------------------------------------------------
1 | - beans:
2 | - constructors:
3 | 0: zero
4 | 1: one
5 | 2: two
6 | name: Name
7 | type: Type
--------------------------------------------------------------------------------
/karavan-core/test/circuitBreaker.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-1
3 | from:
4 | uri: direct
5 | parameters:
6 | name: direct1
7 | id: from-1
8 | steps:
9 | - circuitBreaker:
10 | id: cb-1
11 | resilience4jConfiguration:
12 | id: rc-1
13 | minimumNumberOfCalls: 5
14 | failureRateThreshold: 50
15 | steps:
16 | - log:
17 | message: hello11
18 | id: log-1
19 | logName: log11
20 |
--------------------------------------------------------------------------------
/karavan-core/test/cxf.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: exampleRoute
3 | from:
4 | uri: cxf://{{output.url}}
5 | parameters:
6 | wsdlURL: '{{input.wsdl}}'
7 | dataFormat: PAYLOAD
8 | address: '//{{output.url}}'
9 | steps:
10 | - to:
11 | uri: cxf:bean:beanName
12 | parameters:
13 | beanId: bean:beanName
14 | wsdlURL: '{{output.wsdl}}'
15 | dataFormat: PAYLOAD
16 |
--------------------------------------------------------------------------------
/karavan-core/test/demo.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: camel.apache.org/v1
2 | kind: Integration
3 | metadata:
4 | name: 'demo'
5 | spec:
6 | flows:
7 | - route:
8 | from:
9 | uri: kamelet:http-secured-source
10 | steps:
11 | - doTry:
12 | steps:
13 | - to: "log:when-a"
14 | - to: "log:when-b"
15 | doCatch:
16 | - exception:
17 | - "java.io.FileNotFoundException"
18 | - "java.io.IOException"
19 | onWhen:
20 | expression:
21 | simple: "${body.size()} == 1"
22 | steps:
23 | - to: "log:io-error"
24 | - choice:
25 | when:
26 | - expression:
27 | simple: "${body.size()} == 1"
28 | steps:
29 | - toD: "log:xxx"
30 | otherwise:
31 | steps:
32 | - toD: "log:yyy"
--------------------------------------------------------------------------------
/karavan-core/test/doCatchOnWhen.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-8a40
3 | nodePrefixId: route-78f
4 | from:
5 | id: from-674b
6 | uri: timer
7 | parameters:
8 | timerName: name
9 | steps:
10 | - doTry:
11 | id: doTry-258c
12 | doCatch:
13 | - id: doCatch-32ac
14 | exception:
15 | - java.lang.ArrayIndexOutOfBoundsException
16 | onWhen:
17 | id: when-b4f0
18 | expression:
19 | groovy:
20 | id: groovy-2d4f
21 |
--------------------------------------------------------------------------------
/karavan-core/test/doCatchOnWhen.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import * as fs from 'fs';
18 | import 'mocha';
19 | import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml";
20 | import {CamelUtil} from "../src/core/api/CamelUtil";
21 | import {CamelDefinitionApiExt} from "../src/core/api/CamelDefinitionApiExt";
22 | import {CatchDefinition, FromDefinition} from "../src/core/model/CamelDefinition";
23 | import {expect} from "chai";
24 | import {TryDefinition} from "../src/core/model/CamelDefinition";
25 |
26 | describe('DoCatch', () => {
27 |
28 | it('on When', () => {
29 | const yaml = fs.readFileSync('test/doCatchOnWhen.camel.yaml',{encoding:'utf8', flag:'r'});
30 | const i = CamelDefinitionYaml.yamlToIntegration("demo.yaml", yaml);
31 | const yaml2 = CamelDefinitionYaml.integrationToYaml(i);
32 |
33 | expect(yaml2).to.equal(yaml);
34 | });
35 |
36 | });
--------------------------------------------------------------------------------
/karavan-core/test/errorHandler1.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-1
3 | from:
4 | id: from-1
5 | uri: kamelet:timer-source
6 | parameters:
7 | period: 1000
8 | message: "1"
9 | steps:
10 | - setBody:
11 | id: setBody-1
12 | expression:
13 | groovy:
14 | id: groovy-10a6
15 | expression: 1000 / 0
16 | - log:
17 | id: log-1
18 | message: $[body}
19 | - routeConfiguration:
20 | id: routeConfiguration-1
21 | errorHandler:
22 | id: errorHandler-1
23 | deadLetterChannel:
24 | id: deadLetterChannel-1
25 | deadLetterUri: log:dlq
26 | useOriginalMessage: true
27 | level: TRACE
28 |
--------------------------------------------------------------------------------
/karavan-core/test/getElementProperties.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import {expect} from 'chai';
18 | import 'mocha';
19 | import {CamelDefinitionApiExt} from "../src/core/api/CamelDefinitionApiExt";
20 | import {PropertyMeta} from "../src/core/model/CamelMetadata";
21 |
22 | describe('getElementProperties', () => {
23 |
24 | it('getElementProperties 1', () => {
25 |
26 | const p: PropertyMeta[] = CamelDefinitionApiExt.getElementProperties("FromDefinition");
27 | expect(p.length).to.equal(5);
28 |
29 | });
30 |
31 |
32 | });
--------------------------------------------------------------------------------
/karavan-core/test/getElementPropertiesByName.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import {expect} from 'chai';
18 | import 'mocha';
19 | import {CamelDefinitionApiExt} from "../src/core/api/CamelDefinitionApiExt";
20 | import {PropertyMeta} from "../src/core/model/CamelMetadata";
21 |
22 | describe('getElementPropertiesByName', () => {
23 |
24 | it('getElementPropertiesByName 1', () => {
25 |
26 | const p: PropertyMeta[] = CamelDefinitionApiExt.getElementPropertiesByName("json");
27 | expect(p.length).to.equal(24);
28 | });
29 |
30 |
31 | });
--------------------------------------------------------------------------------
/karavan-core/test/hasElementWithId1.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-0dc7
3 | description: Audit Start
4 | nodePrefixId: route-972
5 | from:
6 | id: fhello-world
7 | description: Audit Start
8 | uri: direct
9 | parameters:
10 | name: start
11 | steps:
12 | - to:
13 | id: fhello-world
14 | uri: kafka
15 | parameters:
16 | topic: audit
17 |
--------------------------------------------------------------------------------
/karavan-core/test/integration1.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: camel.apache.org/v1
2 | kind: Integration
3 | metadata:
4 | name: test1.yaml
5 | spec:
6 | flows:
7 | - from:
8 | uri: kamelet:timer-source
9 | steps:
10 | - log:
11 | message: wwwww
12 | - filter:
13 | expression:
14 | constant:
15 | expression: Hello Yaml !!!
16 | steps:
17 | - to:
18 | uri: log
19 | parameters:
20 | level: 'OFF'
21 | logMask: true
22 | parameters:
23 | period: 1000
24 | message: qqq
25 |
--------------------------------------------------------------------------------
/karavan-core/test/integration2.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: camel.apache.org/v1
2 | kind: Integration
3 | metadata:
4 | name: test1.yaml
5 | spec:
6 | flows:
7 | - from:
8 | uri: kamelet:timer-source
9 | steps:
10 | - log:
11 | message: wwwww
12 | - filter:
13 | expression:
14 | constant: Hello Yaml !!!
15 | steps:
16 | - to:
17 | uri: log
18 | parameters:
19 | level: 'OFF'
20 | logMask: true
21 | parameters:
22 | period: 1000
23 | message: qqq
24 |
--------------------------------------------------------------------------------
/karavan-core/test/intercept.yaml:
--------------------------------------------------------------------------------
1 | - routeConfiguration:
2 | intercept:
3 | - intercept:
4 | id: intercept-9b31
5 | steps:
6 | - log:
7 | message: Interceptor ${body}
8 | id: log-c2f5
9 | - route:
10 | id: route-ddaa
11 | from:
12 | uri: kamelet:timer-source
13 | id: from-847d
14 | parameters:
15 | message: Hello
16 | steps:
17 | - log:
18 | message: Main ${body}
19 | id: log-7972
--------------------------------------------------------------------------------
/karavan-core/test/multiObjectProperties1.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-e653
3 | from:
4 | uri: direct1
5 | id: from-6ecf
6 | steps:
7 | - saga:
8 | option:
9 | - key: key1
10 | expression:
11 | simple: ${body}
12 | - key: key2
13 | expression:
14 | simple: ${headers}
15 | id: saga-726c
16 | steps:
17 | - to:
18 | uri: direct:direct2
19 | id: to-efd8
20 |
--------------------------------------------------------------------------------
/karavan-core/test/multiple.yaml:
--------------------------------------------------------------------------------
1 | - from:
2 | uri: netty-http
3 | parameters:
4 | protocol: http
5 | host: localhost
6 | port: 8080
7 | path: demo
8 | steps:
9 | - convertBodyTo:
10 | type: String
11 | - unmarshal:
12 | json: {}
13 | - choice:
14 | when:
15 | - expression:
16 | simple: ${body[amount]} < 1000
17 | steps:
18 | - log:
19 | message: 'WHEN: ${body}'
20 | logging-level: INFO
21 | log-name: when
22 | otherwise:
23 | steps:
24 | - log:
25 | log-name: otherwise
26 | logging-level: INFO
27 | message: 'OTHERWISE: ${body}'
28 | - from:
29 | uri: kamelet:aws-kinesis-source
--------------------------------------------------------------------------------
/karavan-core/test/openapi.yaml:
--------------------------------------------------------------------------------
1 | - rest:
2 | id: rest-1
3 | description: Hello World
4 | path: /demo
5 | openApi:
6 | id: openapi-1
7 | specification: openapi.json
8 |
--------------------------------------------------------------------------------
/karavan-core/test/placeholder.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import {expect} from 'chai';
18 | import * as fs from 'fs';
19 | import 'mocha';
20 | import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml";
21 | import {CamelUtil} from "../src/core/api/CamelUtil";
22 |
23 | describe('Get Placeholders', () => {
24 |
25 | it('Get Placeholders', () => {
26 | const yaml = fs.readFileSync('test/placeholder.yaml',{encoding:'utf8', flag:'r'});
27 | const i = CamelDefinitionYaml.yamlToIntegration("test1.yaml", yaml);
28 | const placeholders = CamelUtil.findPlaceholdersInObject(i);
29 | expect(placeholders.size).to.equal(4);
30 | });
31 |
32 | });
33 |
--------------------------------------------------------------------------------
/karavan-core/test/plain-try-catch.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-1
3 | from:
4 | id: from-1
5 | uri: timer
6 | parameters:
7 | name: info
8 | steps:
9 | - doTry:
10 | id: doTry-1
11 | doCatch:
12 | - id: doCatch-1
13 | exception:
14 | - java.lang.ArithmeticException
15 | steps:
16 | - log:
17 | id: log-1
18 | message: Exception
19 | doFinally:
20 | id: doFinally-1
21 | steps:
22 | - log:
23 | id: log-2
24 | message: ${body}
25 | steps:
26 | - setBody:
27 | id: setBody-1
28 | expression:
29 | groovy:
30 | id: groovy-1
31 | expression: 1000 / 0
32 |
--------------------------------------------------------------------------------
/karavan-core/test/plain1.yaml:
--------------------------------------------------------------------------------
1 | - from:
2 | uri: timer
3 | id: from-1
4 | parameters:
5 | name: info
6 | steps:
7 | - choice:
8 | when:
9 | - expression:
10 | simple:
11 | expression: ${headers} != null
12 | steps:
13 | - log:
14 | message: hello11
15 | logName: log11
16 | - expression:
17 | simple:
18 | expression: ${headers} == null
19 | steps:
20 | - log:
21 | message: hello22
22 | logName: log22
23 |
--------------------------------------------------------------------------------
/karavan-core/test/plain2.yaml:
--------------------------------------------------------------------------------
1 | - from:
2 | uri: timer
3 | id: from-1
4 | parameters:
5 | name: info
6 | steps:
7 | - set-body:
8 | expression:
9 | constant:
10 | expression: Hello Yaml !!!
11 | - log:
12 | message: ${body}
13 | logName: log11
14 |
--------------------------------------------------------------------------------
/karavan-core/test/plain3.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | autoStartup: true
3 | id: route-1
4 | from:
5 | id: from-f6d9
--------------------------------------------------------------------------------
/karavan-core/test/plain4.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-1
3 | autoStartup: false
4 | from:
5 | id: from-f6d9
6 |
--------------------------------------------------------------------------------
/karavan-core/test/restConfigDsl.yaml:
--------------------------------------------------------------------------------
1 | - rest:
2 | id: rest-6df5
3 | post:
4 | - id: post-9b00
5 | to: direct:direct1
6 | path: path1
7 | - rest:
8 | id: rest-8b5c
9 | post:
10 | - id: post-2c9e
11 | to: direct:direct2
12 | path: path2
13 | - restConfiguration:
14 | port: '8080'
15 | host: localhost
16 |
--------------------------------------------------------------------------------
/karavan-core/test/restDsl.yaml:
--------------------------------------------------------------------------------
1 | apiVersion: camel.apache.org/v1
2 | kind: Integration
3 | metadata:
4 | name: RestDsl
5 | spec:
6 | flows:
7 | - rest-configuration:
8 | component: "platform-http"
9 | context-path: "/base"
10 | port: 8081
11 | - rest:
12 | path: "/demo"
13 | post:
14 | - path: "/foo"
15 | to: "direct:foo"
16 | - path: "/bar"
17 | to: "direct:bar"
18 | get:
19 | - path: "/getFoo"
20 | to: "direct:foo"
21 | - path: "/getBar"
22 | to: "direct:foo"
23 | - from:
24 | uri: 'direct:foo'
25 | steps:
26 | - log: '${body}'
27 | - log: '${headers}'
28 | - setBody:
29 | constant: "Hello world"
--------------------------------------------------------------------------------
/karavan-core/test/routeTemplate1.camel.yaml:
--------------------------------------------------------------------------------
1 | - routeTemplate:
2 | id: routeFileReaderTemplate
3 | description: File reader
4 | route:
5 | id: routeFileReader
6 | description: File reader
7 | from:
8 | id: from-c667
9 | description: Read file
10 | uri: file
11 | parameters:
12 | directoryName: "{{folderName}}"
13 | noop: true
14 | steps:
15 | - to:
16 | id: to-1234
17 | uri: direct
18 | parameters:
19 | name: converter
20 | parameters:
21 | - name: folderName
22 |
--------------------------------------------------------------------------------
/karavan-core/test/routeTemplate2.camel.yaml:
--------------------------------------------------------------------------------
1 | - routeTemplate:
2 | id: routeFileReaderTemplate
3 | description: File reader
4 | route:
5 | id: routeFileReader
6 | description: File reader
7 | from:
8 | id: from-c667
9 | description: Read file
10 | uri: file
11 | parameters:
12 | directoryName: "{{folderName}}"
13 | noop: true
14 | steps:
15 | - to:
16 | id: to-1234
17 | uri: direct
18 | parameters:
19 | name: converter
20 | parameters:
21 | - name: folderName
22 | - route:
23 | id: route-dummy
24 | autoStartup: false
25 | from:
26 | id: from-dummy
27 | uri: direct
28 | parameters:
29 | name: dummy
30 | steps:
31 | - log:
32 | id: log-b47b
33 | message: DUMMY
34 |
--------------------------------------------------------------------------------
/karavan-core/test/routes1.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-ea82
3 | from:
4 | id: from-1
5 | uri: timer
6 | parameters:
7 | name: info
8 | steps:
9 | - choice:
10 | id: choice-1
11 | when:
12 | - id: when-1
13 | expression:
14 | simple:
15 | id: simple-1
16 | expression: ${headers} != null
17 | steps:
18 | - log:
19 | id: log-1
20 | message: hello11
21 | logName: log11
22 | - id: when-2
23 | expression:
24 | simple:
25 | id: simple-2
26 | expression: ${headers} == null
27 | steps:
28 | - log:
29 | id: log-2
30 | message: hello22s
31 | logName: log22
32 |
--------------------------------------------------------------------------------
/karavan-core/test/supportedComponents.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import {expect} from 'chai';
18 | import * as fs from 'fs';
19 | import 'mocha';
20 | import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml";
21 | import {ComponentApi} from "../src/core/api/ComponentApi";
22 | import {SupportedComponent} from "../src/core/model/ComponentModels";
23 |
24 |
25 | describe('Supported Components List', () => {
26 |
27 | it('Read Supported Components', () => {
28 | const json = fs.readFileSync('test/supported-components.json',{encoding:'utf8', flag:'r'});
29 | ComponentApi.saveSupportedComponents(json);
30 | const sc = ComponentApi.getSupportedComponents();
31 | expect(sc.length).to.equal(305);
32 | });
33 |
34 | });
35 |
--------------------------------------------------------------------------------
/karavan-core/test/template1.AggregationStrategy.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.AggregationStrategy;
2 | import org.apache.camel.Configuration;
3 | import org.apache.camel.BindToRegistry;
4 | import org.apache.camel.Exchange;
5 |
6 | @Configuration
7 | @BindToRegistry("${NAME}")
8 | public class ${NAME} implements AggregationStrategy {
9 | @Override
10 | public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
11 |
12 | if (oldExchange == null) {
13 | return newExchange;
14 | }
15 |
16 | String oldBody = oldExchange.getIn().getBody(String.class);
17 | String newBody = newExchange.getIn().getBody(String.class);
18 | oldExchange.getIn().setBody(oldBody + "+" + newBody);
19 | return oldExchange;
20 | }
21 | }
--------------------------------------------------------------------------------
/karavan-core/test/template1.Processor.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.BindToRegistry;
2 | import org.apache.camel.Configuration;
3 | import org.apache.camel.Exchange;
4 | import org.apache.camel.Processor;
5 |
6 | @Configuration
7 | @BindToRegistry("${NAME}")
8 | public class ${NAME} implements Processor {
9 |
10 | public void process(Exchange exchange) throws Exception {
11 | exchange.getIn().setBody("Hello World");
12 | }
13 | }
--------------------------------------------------------------------------------
/karavan-core/test/template2.AggregationStrategy.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.AggregationStrategy;
2 | import org.apache.camel.Configuration;
3 | import org.apache.camel.BindToRegistry;
4 | import org.apache.camel.Exchange;
5 |
6 | @Configuration
7 | @BindToRegistry("CustomAggregationStrategy")
8 | public class CustomAggregationStrategy implements AggregationStrategy {
9 | @Override
10 | public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
11 |
12 | if (oldExchange == null) {
13 | return newExchange;
14 | }
15 |
16 | String oldBody = oldExchange.getIn().getBody(String.class);
17 | String newBody = newExchange.getIn().getBody(String.class);
18 | oldExchange.getIn().setBody(oldBody + "+" + newBody);
19 | return oldExchange;
20 | }
21 | }
--------------------------------------------------------------------------------
/karavan-core/test/template2.Processor.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.BindToRegistry;
2 | import org.apache.camel.Configuration;
3 | import org.apache.camel.Exchange;
4 | import org.apache.camel.Processor;
5 |
6 | @Configuration
7 | @BindToRegistry("CustomProcessor")
8 | public class CustomProcessor implements Processor {
9 |
10 | public void process(Exchange exchange) throws Exception {
11 | exchange.getIn().setBody("Hello World");
12 | }
13 | }
--------------------------------------------------------------------------------
/karavan-core/test/tod.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import {expect} from 'chai';
18 | import * as fs from 'fs';
19 | import 'mocha';
20 | import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml";
21 |
22 |
23 | describe('ToDynamicDefinition', () => {
24 |
25 | it('ToDynamicDefinition URI', () => {
26 | const yaml = fs.readFileSync('test/tod.yaml',{encoding:'utf8', flag:'r'});
27 | const i = CamelDefinitionYaml.yamlToIntegration("test1.yaml", yaml);
28 | expect(i.spec.flows?.[0].from.steps[0].uri, 'kafka:${header.foo}')
29 | });
30 |
31 | });
32 |
--------------------------------------------------------------------------------
/karavan-core/test/tod.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-f435
3 | from:
4 | uri: kamelet:timer-source
5 | id: from-e52c
6 | steps:
7 | - toD:
8 | uri: kafka:${header.foo}
9 | id: toD-0d39
--------------------------------------------------------------------------------
/karavan-core/test/topology1.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-c67f1
3 | description: Timer Scheduler
4 | from:
5 | uri: kamelet:timer-source
6 | id: from-b4181
7 | parameters:
8 | message: Hello
9 | steps:
10 | - log:
11 | message: ${body}
12 | id: log-a68a1
13 | - route:
14 | id: route-2cbd1
15 | from:
16 | uri: kamelet:aws-cloudtrail-source
17 | id: from-a3f61
18 | parameters:
19 | region: fff
20 | steps:
21 | - to:
22 | uri: kamelet:google-pubsub-sink
23 | id: to-c27f1
24 | - route:
25 | id: route-de2b1
26 | from:
27 | uri: amqp
28 | id: from-1e661
29 | steps:
30 | - to:
31 | uri: direct
32 | id: to-6a041
33 | parameters:
34 | name: xxxx
35 | - route:
36 | id: route-ec4e1
37 | from:
38 | uri: direct
39 | id: from-e9181
40 | parameters:
41 | name: xxx
42 | steps:
43 | - to:
44 | uri: kamelet:kafka-not-secured-sink
45 | id: to-a47b1
46 | - rest:
47 | id: rest-b499
48 | get:
49 | - to: direct:xxx
50 | id: get-cb63
51 | post:
52 | - to: direct:xxx
53 | id: post-07e4
54 | put:
55 | - to: direct:xxx
56 | id: put-8271
--------------------------------------------------------------------------------
/karavan-core/test/topology2.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-c67f
3 | from:
4 | uri: kamelet:timer-source
5 | id: from-b418
6 | parameters:
7 | message: Hello
8 | steps:
9 | - log:
10 | message: ${body}
11 | id: log-a68a
12 | - route:
13 | id: route-2cbd
14 | from:
15 | uri: kamelet:aws-cloudtrail-source
16 | id: from-a3f6
17 | parameters:
18 | region: fff
19 | steps:
20 | - to:
21 | uri: kamelet:google-pubsub-sink
22 | id: to-c27f
23 | - route:
24 | id: route-de2b
25 | from:
26 | uri: amqp
27 | id: from-1e66
28 | steps:
29 | - to:
30 | uri: direct
31 | id: to-6a04
32 | parameters:
33 | name: xxxx
34 | - route:
35 | id: route-ec4e
36 | from:
37 | uri: direct
38 | id: from-e918
39 | parameters:
40 | name: xxx
41 | steps:
42 | - to:
43 | uri: kamelet:kafka-not-secured-sink
44 | id: to-a47b
45 |
--------------------------------------------------------------------------------
/karavan-core/test/topology3.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-6312
3 | description: File Send
4 | nodePrefixId: route-b7f
5 | autoStartup: true
6 | from:
7 | id: file-send-direct
8 | uri: direct
9 | parameters:
10 | name: send-roster-files
11 | synchronous: false
12 | steps:
13 | - log:
14 | id: log-894b
15 | message: "DEBUG: Transfer Starting ${date:now:yyyyMMdd hh:mm:ss}"
16 | - routeConfiguration:
17 | errorHandler:
18 | id: errorHandler-1b09
19 | deadLetterChannel:
20 | id: deadLetterChannel-2cf3
21 | deadLetterUri: direct:dlq
22 | redeliveryPolicy:
23 | id: redeliveryPolicy-58fe
24 | maximumRedeliveries: 5
25 | redeliveryDelay: "60000"
26 | useOriginalMessage: false
27 | useOriginalBody: false
28 |
--------------------------------------------------------------------------------
/karavan-core/test/tsconfig.testing.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "module": "ES2022",
4 | "target": "ES2022",
5 | "lib": [
6 | "dom",
7 | "dom.iterable",
8 | "esnext",
9 | "ES2021",
10 | "ES2021.String"
11 | ]
12 | },
13 | "include": ["**/*.spec.ts"]
14 | }
15 |
--------------------------------------------------------------------------------
/karavan-core/test/variable1.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-18e5
3 | nodePrefixId: route-656
4 | from:
5 | id: from-9468
6 | uri: amqp
7 | variableReceive: global:variable1
8 | steps:
9 | - doTry:
10 | id: doTry-8bb0
11 | doCatch:
12 | - id: doCatch-19a9
13 | steps:
14 | - convertVariableTo:
15 | id: convertVariableTo-b0e5
16 | name: xxx
17 | toName: yyy
18 | steps:
19 | - multicast:
20 | id: multicast-ad44
21 | steps:
22 | - to:
23 | id: to-0c20
24 | variableSend: send1
25 | variableReceive: receive1
26 | uri: activemq
27 | - to:
28 | id: to-e79a
29 | variableSend: route:aran1
30 | variableReceive: route:aran1
31 | uri: arangodb
32 | - setVariable:
33 | id: setVariable-957d
34 | name: varrr
35 | expression:
36 | simple:
37 | id: simple-cd4b
38 | - to:
39 | id: to-60f8
40 | variableSend: hello
41 | variableReceive: world
42 | uri: amqp
43 |
--------------------------------------------------------------------------------
/karavan-core/test/variable2.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-18e5
3 | nodePrefixId: route-656
4 | from:
5 | id: from-9468
6 | uri: amqp
7 | variableReceive: variable2
8 | steps:
9 | - doTry:
10 | id: doTry-8bb0
11 | doCatch:
12 | - id: doCatch-19a9
13 | steps:
14 | - convertVariableTo:
15 | id: convertVariableTo-b0e5
16 | name: xxx2
17 | toName: yyy2
18 | steps:
19 | - multicast:
20 | id: multicast-ad44
21 | steps:
22 | - to:
23 | id: to-0c20
24 | variableSend: asend2
25 | variableReceive: breceive2
26 | uri: activemq
27 | - to:
28 | id: to-e79a
29 | variableSend: route:aran2
30 | variableReceive: global:aran2
31 | uri: arangodb
32 | - setVariable:
33 | id: setVariable-957d
34 | name: varrr2
35 | expression:
36 | simple:
37 | id: simple-cd4b
38 | - to:
39 | id: to-60f8
40 | variableSend: hello2
41 | variableReceive: world2
42 | uri: amqp
43 |
--------------------------------------------------------------------------------
/karavan-core/test/variables.spec.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import {expect} from 'chai';
18 | import * as fs from 'fs';
19 | import 'mocha';
20 | import { VariableUtil } from '../src/core/api/VariableUtil';
21 | import { IntegrationFile } from '../src/core/model/IntegrationDefinition';
22 |
23 | describe('Variables', () => {
24 |
25 | it('Find Variables', () => {
26 | const yaml1 = fs.readFileSync('test/variable1.camel.yaml',{encoding:'utf8', flag:'r'});
27 | const yaml2 = fs.readFileSync('test/variable2.camel.yaml',{encoding:'utf8', flag:'r'});
28 | const variables = VariableUtil.findVariables([
29 | new IntegrationFile('variable1.camel.yaml', yaml1)
30 | , new IntegrationFile('variable2.camel.yaml', yaml2)
31 | ]);
32 | expect(variables.length).to.equal(19);
33 | });
34 | });
--------------------------------------------------------------------------------
/karavan-core/test/yamDataFormat.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-7447
3 | from:
4 | id: from-875e
5 | uri: direct1
6 | steps:
7 | - marshal:
8 | id: marshal-7abc
9 | yaml:
10 | id: yaml-b347
11 | library: hello
12 | constructor: any-constructor
13 |
14 |
--------------------------------------------------------------------------------
/karavan-core/test/yamDataFormat1.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-7447
3 | from:
4 | id: from-875e
5 | uri: direct1
6 | steps:
7 | - marshal:
8 | id: marshal-7abc
9 | yaml:
10 | id: yaml-b347
11 | library: hello
12 |
--------------------------------------------------------------------------------
/karavan-core/test/yamDataFormat2.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-7447
3 | from:
4 | id: from-875e
5 | uri: direct1
6 | steps:
7 | - marshal:
8 | id: marshal-7abc
9 | yaml:
10 | id: yaml-b347
11 | library: hello
12 | constructor: test
13 |
--------------------------------------------------------------------------------
/karavan-core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "ts-node": {
3 | "transpileOnly": true,
4 | "esm": true
5 | },
6 | "compilerOptions": {
7 | "target": "ES2022",
8 | "module": "es2022",
9 | "declaration": true,
10 | "outDir": "./lib",
11 | "strict": true,
12 | "lib": [
13 | "dom",
14 | "dom.iterable",
15 | "esnext",
16 | "ES2021",
17 | "ES2021.String"
18 | ],
19 | "moduleResolution": "node",
20 | "resolveJsonModule": true,
21 | "isolatedModules": true
22 | },
23 | "tsc-alias": {
24 | "resolveFullPaths": true,
25 | "verbose": false
26 | },
27 | "include": [
28 | "src"
29 | ],
30 | "exclude": [
31 | "node_modules",
32 | "**/test/*"
33 | ]
34 | }
35 |
--------------------------------------------------------------------------------
/karavan-designer/index.html:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Karavan-Designer
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/karavan-designer/public/example/demo.camel.yaml:
--------------------------------------------------------------------------------
1 | - route:
2 | id: route-1eda
3 | from:
4 | id: from-b189
5 | uri: direct
6 | parameters:
7 | name: getUser
8 | steps:
9 | - to:
10 | id: to-a36b
11 | uri: amqp
12 | parameters:
13 | destinationName: hello
14 | clientId: world
15 | - to:
16 | id: to-6d55
17 | uri: bean
18 | parameters:
19 | beanName: userService
20 | method: getUser(${header.id})
21 | - filter:
22 | id: filter-64ac
23 | expression:
24 | simple:
25 | id: simple-12cd
26 | expression: ${body} == null
27 | steps:
28 | - setHeader:
29 | id: setHeader-392d
30 | name: Exchange.HTTP_RESPONSE_CODE
31 | expression:
32 | constant:
33 | id: constant-9d21
34 | expression: 404
35 | - routeConfiguration: {}
36 |
--------------------------------------------------------------------------------
/karavan-designer/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-designer/public/favicon.ico
--------------------------------------------------------------------------------
/karavan-designer/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Karavan",
3 | "name": "Karavan",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/karavan-designer/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/karavan-designer/public/snippets/org.apache.camel.AggregationStrategy:
--------------------------------------------------------------------------------
1 | import org.apache.camel.BindToRegistry;
2 | import org.apache.camel.Exchange;
3 | import org.apache.camel.Processor;
4 |
5 | @BindToRegistry("NAME")
6 | public class NAME implements Processor {
7 |
8 | public void process(Exchange exchange) throws Exception {
9 | exchange.getIn().setBody("Hello World");
10 | }
11 | }
--------------------------------------------------------------------------------
/karavan-designer/public/snippets/org.apache.camel.Processor:
--------------------------------------------------------------------------------
1 | import org.apache.camel.BindToRegistry;
2 | import org.apache.camel.Exchange;
3 | import org.apache.camel.Processor;
4 |
5 | @BindToRegistry("NAME")
6 | public class NAME implements Processor {
7 |
8 | public void process(Exchange exchange) throws Exception {
9 | exchange.getIn().setBody("Hello World");
10 | }
11 | }
--------------------------------------------------------------------------------
/karavan-designer/src/App.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | .App {
18 | background-color: var(--background);
19 | }
20 |
--------------------------------------------------------------------------------
/karavan-designer/src/KnowledgebaseHome.tsx:
--------------------------------------------------------------------------------
1 | import { KnowledgebasePage } from "./knowledgebase/KnowledgebasePage"
2 | import { ComponentApi } from "karavan-core/lib/api/ComponentApi";
3 | import { KameletApi } from "karavan-core/lib/api/KameletApi";
4 | interface Props {
5 | dark: boolean,
6 | }
7 | export const KnowledgebaseHome = (props: Props) => {
8 |
9 |
10 | const onchangeBlockedList = (type: string, name: string, checked: boolean) => {
11 | if (type === 'kamelet') {
12 |
13 | const blockedKamelet = KameletApi.saveBlockedKameletName(name, checked);
14 | }
15 | else if (type === 'component') {
16 | const blockedComponent = ComponentApi.saveBlockedComponentName(name, checked);
17 | }
18 | }
19 | return (
20 | onchangeBlockedList(type, name, checked)} />
21 | );
22 | }
--------------------------------------------------------------------------------
/karavan-designer/src/designer/ErrorBoundaryWrapper.tsx:
--------------------------------------------------------------------------------
1 | import React, {ReactNode} from "react";
2 |
3 | export interface ErrorBoundaryState {
4 | hasError: boolean;
5 | error: Error | null;
6 | }
7 |
8 | export class ErrorBoundaryWrapper extends React.Component<{
9 | children: ReactNode;
10 | onError: (error: Error) => void;
11 | }> {
12 | componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
13 | // Handle error (logging, etc.)
14 | console.error("Error caught in ErrorBoundary:", error, errorInfo);
15 | this.props.onError(error);
16 | }
17 |
18 | render() {
19 | return this.props.children;
20 | }
21 | }
--------------------------------------------------------------------------------
/karavan-designer/src/designer/kamelet/KameletDesigner.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import React from 'react';
18 | import {
19 | PageSection,
20 | } from '@patternfly/react-core';
21 | import '../karavan.css';
22 | import './kamelet.css';
23 | import {KameletAnnotationsPanel} from "./KameletAnnotationsPanel";
24 | import {KameletDefinitionsPanel} from "./KameletDefinitionsPanel";
25 |
26 | export function KameletDesigner() {
27 |
28 | return (
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | )
37 | }
38 |
--------------------------------------------------------------------------------
/karavan-designer/src/designer/kamelet/kamelet.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .kamelet-designer {
19 | display: block;
20 | height: 100vh;
21 | width: 100%;
22 | overflow-y: auto;
23 | padding-bottom: 106px;
24 | }
25 |
26 | .karavan .kamelet-designer .pf-v5-c-drawer__content,
27 | .karavan .kamelet-designer .main {
28 | background-color: var(--pf-v5-global--BackgroundColor--light-300);
29 | }
30 | .karavan .kamelet-designer .icon {
31 | height: 20px;
32 | width: 20px;
33 | border: none;
34 | -webkit-user-select: none;
35 | -o-user-select: none;
36 | user-select: none;
37 | }
38 |
39 | .karavan .kamelet-designer .properties {
40 | padding: 10px 10px 10px 10px;
41 | background: transparent;
42 | width: 100%;
43 | height: 100%;
44 | overflow: auto;
45 | display: flex;
46 | flex-direction: column;
47 | justify-content: space-between;
48 | }
--------------------------------------------------------------------------------
/karavan-designer/src/designer/property/property/PropertyPlaceholderDropdown.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .properties .property-placeholder-toggle {
19 | padding-left: 6px;
20 | padding-right: 6px;
21 | }
22 |
23 | .karavan .properties .property-placeholder-toggle .pf-v5-c-button__icon.pf-m-start {
24 | margin-inline-end: 0;
25 | }
26 |
27 | .karavan .properties .property-placeholder-toggle .pf-v5-c-menu-toggle__controls {
28 | display: none;
29 | }
30 |
31 | .karavan .properties .property-placeholder-dropdown .pf-v5-c-menu__group-title {
32 | font-weight: bold;
33 | font-size: 13px;
34 | }
35 |
36 | .pf-v5-c-popover .property-placeholder-toggle-form {
37 | width: 300px;
38 | }
39 |
40 | .pf-v5-c-popover .property-placeholder-toggle-form .pf-v5-c-form__group {
41 | grid-template-columns: 1fr 2fr;
42 | }
--------------------------------------------------------------------------------
/karavan-designer/src/designer/property/property/VariablesDropdown.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .properties .variables-toggle {
19 | padding-left: 6px;
20 | padding-right: 6px;
21 | }
22 |
23 | .karavan .properties .variables-toggle .pf-v5-c-button__icon.pf-m-start {
24 | margin-inline-end: 0;
25 | }
26 |
27 | .karavan .properties .variables-toggle .pf-v5-c-menu-toggle__controls {
28 | display: none;
29 | }
30 |
31 | .pf-v5-c-popover .variables-toggle-form {
32 | width: 300px;
33 | }
34 |
35 | .pf-v5-c-popover .variables-toggle-form .pf-v5-c-form__group {
36 | grid-template-columns: 1fr 2fr;
37 | }
--------------------------------------------------------------------------------
/karavan-designer/src/designer/route/useResizeObserver.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import { useLayoutEffect, useRef } from 'react';
19 |
20 | function useResizeObserver(callback: (target: T, entry: ResizeObserverEntry) => void) {
21 | const ref = useRef(null)
22 |
23 | useLayoutEffect(() => {
24 | const element = ref?.current;
25 | if (!element) {
26 | return;
27 | }
28 | const observer1 = new ResizeObserver((entries) => {
29 | callback(element, entries[0]);
30 | });
31 | observer1.observe(element);
32 | return () => {
33 | observer1.disconnect();
34 | };
35 | }, [callback, ref]);
36 |
37 | return ref
38 | }
39 |
40 | export default useResizeObserver;
--------------------------------------------------------------------------------
/karavan-designer/src/designer/utils/ElementIcon.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 |
19 | .add-button-icon, .insert-button-icon {
20 | fill: var(--pf-v5-global--primary-color--100);
21 | width: 20px;
22 | height: 20px;
23 | background: transparent;
24 | vertical-align: text-bottom;
25 | }
26 |
27 | .copy-button-icon {
28 | width: 20px;
29 | height: 20px;
30 | background: transparent;
31 | vertical-align: text-bottom;
32 | }
33 |
34 | .delete-button-icon {
35 | fill: var(--pf-v5-global--danger-color--100);
36 | width: 20px;
37 | height: 20px;
38 | background: transparent;
39 | vertical-align: text-bottom;
40 | }
41 |
--------------------------------------------------------------------------------
/karavan-designer/src/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import React, {StrictMode} from 'react';
18 | import "./index.css";
19 | import "@patternfly/patternfly/patternfly.css";
20 | import App from "./App";
21 | import {createRoot} from "react-dom/client";
22 |
23 | const container = document.getElementById('root');
24 | const root = createRoot(container!);
25 | root.render(
26 |
27 |
28 |
29 | );
--------------------------------------------------------------------------------
/karavan-designer/src/topology/CustomGroup.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import * as React from 'react';
19 |
20 | import './topology.css';
21 | import {DefaultGroup, LabelPosition, observer} from '@patternfly/react-topology';
22 |
23 | const CustomGroup: React.FC = observer(({ element, ...rest }) => {
24 | return (
25 |
32 |
33 | )
34 | })
35 | export default CustomGroup;
--------------------------------------------------------------------------------
/karavan-designer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": false,
6 | "skipLibCheck": true,
7 | "esModuleInterop": true,
8 | "allowSyntheticDefaultImports": true,
9 | "strict": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "noEmit": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "jsx": "react-jsx",
18 | "types": ["vite/client", "vite-plugin-svgr/client"]
19 | },
20 | "include": ["src"]
21 | }
--------------------------------------------------------------------------------
/karavan-designer/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/karavan-designer/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 | import viteTsconfigPaths from 'vite-tsconfig-paths'
4 |
5 | // https://vitejs.dev/config/
6 | export default defineConfig({
7 | base: '/',
8 | plugins: [react(), viteTsconfigPaths()],
9 | server: {
10 | // this ensures that the browser opens upon server start
11 | open: true,
12 | // this sets a default port to 3000, you can change this
13 | port: 3003,
14 | }
15 | })
--------------------------------------------------------------------------------
/karavan-generator/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.8/apache-maven-3.8.8-bin.zip
18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
19 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinition.header.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * Generated by karavan build tools - do NOT edit this file!
20 | */
21 | import {v4 as uuidv4} from 'uuid';
22 | import {CamelElement} from "./IntegrationDefinition.js";
23 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinition.ts:
--------------------------------------------------------------------------------
1 | export class %1$s extends CamelElement {
2 | %2$s
3 | public constructor(init?: Partial<%1$s>) {
4 | super('%1$s');
5 | Object.assign(this, init);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinitionApi.footer.ts:
--------------------------------------------------------------------------------
1 |
2 | static createSteps = (elements: any[] | undefined): CamelElement[] => {
3 | const result: CamelElement[] = []
4 | if (elements !== undefined){
5 | elements.forEach(e => {
6 | result.push(CamelDefinitionApi.createStep(e.dslName, e));
7 | })
8 | }
9 | return result
10 | }
11 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinitionApi.header.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * Generated by karavan build tools - do NOT edit this file!
20 | */
21 | import {CamelElement} from "../model/IntegrationDefinition.js";
22 | import {
23 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinitionApi.ts:
--------------------------------------------------------------------------------
1 | static create%1$s = (element: any): %1$s => { %2$s
2 | const def = element ? new %1$s({...element}) : new %1$s();
3 | def.uuid = element?.uuid ? element.uuid : def.uuid; %3$s
4 | return def;
5 | }
6 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinitionYamlStep.footer.ts:
--------------------------------------------------------------------------------
1 |
2 | static readSteps = (elements: any[] | undefined): CamelElement[] => {
3 | const result: CamelElement[] = []
4 | if (elements !== undefined){
5 | elements.forEach(e => {
6 | result.push(CamelDefinitionYamlStep.readStep(e));
7 | })
8 | }
9 | return result
10 | }
11 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinitionYamlStep.header.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | /**
19 | * Generated by karavan build tools - do NOT edit this file!
20 | */
21 | import {CamelElement} from "../model/IntegrationDefinition.js";
22 | import {
23 |
24 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/CamelDefinitionYamlStep.ts:
--------------------------------------------------------------------------------
1 | static read%1$s = (element: any): %1$s => {
2 | %2$s
3 | let def = element ? new %1$s({...element}) : new %1$s();%3$s
4 | %4$s
5 | return def;
6 | }
7 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/TraitDefinition.header.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Generated by karavan build tools - do NOT edit this file!
3 | */
4 | import {CamelElement} from "./IntegrationDefinition.js";
5 |
6 | export class TraitPropertyMeta {
7 | name: string
8 | type: string
9 | description: string
10 |
11 | constructor(name: string, type: string, description: string) {
12 | this.name = name;
13 | this.type = type;
14 | this.description = description;
15 | }
16 | }
17 |
18 | export class TraitMeta {
19 | name: string
20 | platform: boolean
21 | profiles: string
22 | description: string
23 | properties: TraitPropertyMeta[]
24 |
25 |
26 | constructor(name: string, platform:boolean, profiles: string, description: string, properties: TraitPropertyMeta[]) {
27 | this.name = name;
28 | this.platform = platform;
29 | this.profiles = profiles;
30 | this.description = description;
31 | this.properties = properties;
32 | }
33 | }
34 |
35 |
--------------------------------------------------------------------------------
/karavan-generator/src/main/resources/application.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-generator/src/main/resources/application.properties
--------------------------------------------------------------------------------
/karavan-space/index.html:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
33 |
34 |
35 | Karavan
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/karavan-space/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-space/public/favicon.ico
--------------------------------------------------------------------------------
/karavan-space/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "Karavan",
3 | "name": "Karavan",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "logo192.png",
12 | "type": "image/png",
13 | "sizes": "192x192"
14 | },
15 | {
16 | "src": "logo512.png",
17 | "type": "image/png",
18 | "sizes": "512x512"
19 | }
20 | ],
21 | "start_url": ".",
22 | "display": "standalone",
23 | "theme_color": "#000000",
24 | "background_color": "#ffffff"
25 | }
26 |
--------------------------------------------------------------------------------
/karavan-space/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/karavan-space/public/snippets/org.apache.camel.AggregationStrategy:
--------------------------------------------------------------------------------
1 | import org.apache.camel.AggregationStrategy;
2 | import org.apache.camel.Exchange;
3 |
4 | import javax.inject.Named;
5 | import javax.inject.Singleton;
6 |
7 | @Singleton
8 | @Named("NAME")
9 | public class NAME implements AggregationStrategy {
10 | @Override
11 | public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
12 |
13 | if (oldExchange == null) {
14 | return newExchange;
15 | }
16 |
17 | String oldBody = oldExchange.getIn().getBody(String.class);
18 | String newBody = newExchange.getIn().getBody(String.class);
19 | oldExchange.getIn().setBody(oldBody + "+" + newBody);
20 | return oldExchange;
21 | }
22 | }
--------------------------------------------------------------------------------
/karavan-space/public/snippets/org.apache.camel.Processor:
--------------------------------------------------------------------------------
1 | import org.apache.camel.Exchange;
2 | import org.apache.camel.Processor;
3 |
4 | import javax.inject.Named;
5 | import javax.inject.Singleton;
6 |
7 | @Singleton
8 | @Named("NAME")
9 | public class NAME implements Processor {
10 |
11 | public void process(Exchange exchange) throws Exception {
12 | exchange.getIn().setBody("Hello World");
13 | }
14 | }
--------------------------------------------------------------------------------
/karavan-space/src/App.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | .App {
18 | background-color: var(--background);
19 | }
20 |
--------------------------------------------------------------------------------
/karavan-space/src/api/GeneratorApi.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | export class GeneratorApi {
19 |
20 | static async generate(filename: string, data: string) {
21 | const response = await fetch("https://kameleon.dev/generator/openapi?filename="+ filename, {
22 | method: 'POST',
23 | mode: 'cors', // no-cors, *cors, same-origin
24 | cache: 'no-cache',
25 | credentials: 'same-origin',
26 | headers: {
27 | 'Content-Type': filename.endsWith("json") ? 'application/json' : 'application/yaml'
28 | },
29 | redirect: 'follow',
30 | referrerPolicy: 'no-referrer',
31 | body: data
32 | });
33 | return response.text();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/karavan-space/src/designer/ErrorBoundaryWrapper.tsx:
--------------------------------------------------------------------------------
1 | import React, {ReactNode} from "react";
2 |
3 | export interface ErrorBoundaryState {
4 | hasError: boolean;
5 | error: Error | null;
6 | }
7 |
8 | export class ErrorBoundaryWrapper extends React.Component<{
9 | children: ReactNode;
10 | onError: (error: Error) => void;
11 | }> {
12 | componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
13 | // Handle error (logging, etc.)
14 | console.error("Error caught in ErrorBoundary:", error, errorInfo);
15 | this.props.onError(error);
16 | }
17 |
18 | render() {
19 | return this.props.children;
20 | }
21 | }
--------------------------------------------------------------------------------
/karavan-space/src/designer/kamelet/KameletDesigner.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import React from 'react';
18 | import {
19 | PageSection,
20 | } from '@patternfly/react-core';
21 | import '../karavan.css';
22 | import './kamelet.css';
23 | import {KameletAnnotationsPanel} from "./KameletAnnotationsPanel";
24 | import {KameletDefinitionsPanel} from "./KameletDefinitionsPanel";
25 |
26 | export function KameletDesigner() {
27 |
28 | return (
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | )
37 | }
38 |
--------------------------------------------------------------------------------
/karavan-space/src/designer/kamelet/kamelet.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .kamelet-designer {
19 | display: block;
20 | height: 100vh;
21 | width: 100%;
22 | overflow-y: auto;
23 | padding-bottom: 106px;
24 | }
25 |
26 | .karavan .kamelet-designer .pf-v5-c-drawer__content,
27 | .karavan .kamelet-designer .main {
28 | background-color: var(--pf-v5-global--BackgroundColor--light-300);
29 | }
30 | .karavan .kamelet-designer .icon {
31 | height: 20px;
32 | width: 20px;
33 | border: none;
34 | -webkit-user-select: none;
35 | -o-user-select: none;
36 | user-select: none;
37 | }
38 |
39 | .karavan .kamelet-designer .properties {
40 | padding: 10px 10px 10px 10px;
41 | background: transparent;
42 | width: 100%;
43 | height: 100%;
44 | overflow: auto;
45 | display: flex;
46 | flex-direction: column;
47 | justify-content: space-between;
48 | }
--------------------------------------------------------------------------------
/karavan-space/src/designer/property/property/DslPropertyField.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | .switch-placeholder {
18 | margin: auto;
19 | padding-right: 12px;
20 | }
21 |
22 | .karavan .properties .route-variable .pf-v5-c-toggle-group__button:before,
23 | .karavan .properties .route-variable .pf-v5-c-toggle-group__button {
24 | border-start-end-radius: 0;
25 | border-end-end-radius: 0;
26 | }
27 |
28 | .karavan .properties .infra-button {
29 | width: 1em;
30 | height: 1em;
31 | vertical-align: -0.125em;
32 | }
--------------------------------------------------------------------------------
/karavan-space/src/designer/property/property/PropertyPlaceholderDropdown.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .properties .property-placeholder-toggle {
19 | padding-left: 6px;
20 | padding-right: 6px;
21 | }
22 |
23 | .karavan .properties .property-placeholder-toggle .pf-v5-c-button__icon.pf-m-start {
24 | margin-inline-end: 0;
25 | }
26 |
27 | .karavan .properties .property-placeholder-toggle .pf-v5-c-menu-toggle__controls {
28 | display: none;
29 | }
30 |
31 | .karavan .properties .property-placeholder-dropdown .pf-v5-c-menu__group-title {
32 | font-weight: bold;
33 | font-size: 13px;
34 | }
35 |
36 | .pf-v5-c-popover .property-placeholder-toggle-form {
37 | width: 300px;
38 | }
39 |
40 | .pf-v5-c-popover .property-placeholder-toggle-form .pf-v5-c-form__group {
41 | grid-template-columns: 1fr 2fr;
42 | }
--------------------------------------------------------------------------------
/karavan-space/src/designer/property/property/VariablesDropdown.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | .karavan .properties .variables-toggle {
19 | padding-left: 6px;
20 | padding-right: 6px;
21 | }
22 |
23 | .karavan .properties .variables-toggle .pf-v5-c-button__icon.pf-m-start {
24 | margin-inline-end: 0;
25 | }
26 |
27 | .karavan .properties .variables-toggle .pf-v5-c-menu-toggle__controls {
28 | display: none;
29 | }
30 |
31 | .pf-v5-c-popover .variables-toggle-form {
32 | width: 300px;
33 | }
34 |
35 | .pf-v5-c-popover .variables-toggle-form .pf-v5-c-form__group {
36 | grid-template-columns: 1fr 2fr;
37 | }
--------------------------------------------------------------------------------
/karavan-space/src/designer/route/useResizeObserver.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import { useLayoutEffect, useRef } from 'react';
19 |
20 | function useResizeObserver(callback: (target: T, entry: ResizeObserverEntry) => void) {
21 | const ref = useRef(null)
22 |
23 | useLayoutEffect(() => {
24 | const element = ref?.current;
25 | if (!element) {
26 | return;
27 | }
28 | const observer1 = new ResizeObserver((entries) => {
29 | callback(element, entries[0]);
30 | });
31 | observer1.observe(element);
32 | return () => {
33 | observer1.disconnect();
34 | };
35 | }, [callback, ref]);
36 |
37 | return ref
38 | }
39 |
40 | export default useResizeObserver;
--------------------------------------------------------------------------------
/karavan-space/src/designer/utils/ElementIcon.css:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 |
19 | .add-button-icon, .insert-button-icon {
20 | fill: var(--pf-v5-global--primary-color--100);
21 | width: 20px;
22 | height: 20px;
23 | background: transparent;
24 | vertical-align: text-bottom;
25 | }
26 |
27 | .copy-button-icon {
28 | width: 20px;
29 | height: 20px;
30 | background: transparent;
31 | vertical-align: text-bottom;
32 | }
33 |
34 | .delete-button-icon {
35 | fill: var(--pf-v5-global--danger-color--100);
36 | width: 20px;
37 | height: 20px;
38 | background: transparent;
39 | vertical-align: text-bottom;
40 | }
41 |
--------------------------------------------------------------------------------
/karavan-space/src/designer/utils/ValidatorUtils.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | export function isSensitiveFieldValid(field: string): boolean {
19 | if (field === undefined || field.trim() === "") {
20 | return true;
21 | }
22 | if (field.startsWith("{{") && field.endsWith("}}")) {
23 | const content = field.slice(2, -2).trim();
24 | return content !== "";
25 | }
26 | if (field.startsWith("${") && field.endsWith("}")) {
27 | const content = field.slice(2, -1).trim();
28 | return content !== "";
29 | }
30 | return false;
31 | }
32 |
33 |
34 |
--------------------------------------------------------------------------------
/karavan-space/src/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import React, {StrictMode} from 'react';
18 | import "./index.css";
19 | import "@patternfly/patternfly/patternfly.css";
20 | import App from "./App";
21 | import {createRoot} from "react-dom/client";
22 |
23 | const container = document.getElementById('root');
24 | const root = createRoot(container!);
25 | root.render(
26 |
27 |
28 |
29 | );
--------------------------------------------------------------------------------
/karavan-space/src/topology/CustomEdge.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import * as React from 'react';
19 |
20 | import './topology.css';
21 | import {DefaultEdge, observer} from '@patternfly/react-topology';
22 |
23 |
24 | const CustomEdge: React.FC = observer(({ element, ...rest }) => {
25 | return (
26 |
27 |
28 | )
29 | })
30 | export default CustomEdge;
--------------------------------------------------------------------------------
/karavan-space/src/topology/CustomGroup.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import * as React from 'react';
19 |
20 | import './topology.css';
21 | import {DefaultGroup, LabelPosition, observer} from '@patternfly/react-topology';
22 |
23 | const CustomGroup: React.FC = observer(({ element, ...rest }) => {
24 | return (
25 |
32 |
33 | )
34 | })
35 | export default CustomGroup;
--------------------------------------------------------------------------------
/karavan-space/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ESNext",
4 | "lib": ["dom", "dom.iterable", "esnext"],
5 | "allowJs": false,
6 | "skipLibCheck": true,
7 | "esModuleInterop": true,
8 | "allowSyntheticDefaultImports": true,
9 | "strict": true,
10 | "forceConsistentCasingInFileNames": true,
11 | "module": "esnext",
12 | "moduleResolution": "node",
13 | "resolveJsonModule": true,
14 | "isolatedModules": true,
15 | "noEmit": true,
16 | "noFallthroughCasesInSwitch": true,
17 | "jsx": "react-jsx",
18 | "types": ["vite/client", "vite-plugin-svgr/client"]
19 | },
20 | "include": ["src"]
21 | }
--------------------------------------------------------------------------------
/karavan-space/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
--------------------------------------------------------------------------------
/karavan-space/vite.config.ts:
--------------------------------------------------------------------------------
1 | import { defineConfig } from 'vite'
2 | import react from '@vitejs/plugin-react'
3 | import viteTsconfigPaths from 'vite-tsconfig-paths'
4 |
5 | // https://vitejs.dev/config/
6 | export default defineConfig({
7 | base: '/',
8 | plugins: [react(), viteTsconfigPaths()],
9 | server: {
10 | // this ensures that the browser opens upon server start
11 | open: true,
12 | // this sets a default port to 3000, you can change this
13 | port: 3003,
14 | }
15 | })
--------------------------------------------------------------------------------
/karavan-vscode/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true,
4 | "es2021": true,
5 | "node": true
6 | },
7 | "extends": [
8 | // "eslint:recommended",
9 | // "plugin:react/recommended",
10 | // "plugin:@typescript-eslint/recommended",
11 | // "plugin:prettier/recommended"
12 | ],
13 | "parser": "@typescript-eslint/parser",
14 | "parserOptions": {
15 | "ecmaFeatures": {
16 | "jsx": true
17 | },
18 | "ecmaVersion": 12,
19 | "sourceType": "module"
20 | },
21 | "settings": {
22 | "react": {
23 | "version": "detect"
24 | }
25 | },
26 | "ignorePatterns": ["out", "dist", "**/*.d.ts"],
27 | "plugins": ["react", "@typescript-eslint"],
28 | "rules": {
29 | "@typescript-eslint/explicit-module-boundary-types": "off"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/karavan-vscode/.gitignore:
--------------------------------------------------------------------------------
1 | out
2 | dist
3 | node_modules
4 | .vscode-test/
5 | *.vsix
6 | .DS_Store
7 | .idea
8 | yarn-error.log
9 | webview/designer
10 | webview/components
11 | webview/knowledgebase
12 | webview/kamelets
13 | webview/core
14 | webview/eip
15 | .vscode-test-web
16 |
--------------------------------------------------------------------------------
/karavan-vscode/.prettierignore:
--------------------------------------------------------------------------------
1 | out
2 | dist
3 |
--------------------------------------------------------------------------------
/karavan-vscode/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "Attach",
6 | "port": 9229,
7 | "request": "attach",
8 | "skipFiles": [
9 | "/**"
10 | ],
11 | "type": "extensionHost"
12 | },
13 | {
14 | "name": "Extension",
15 | "type": "extensionHost",
16 | "request": "launch",
17 | "runtimeExecutable": "${execPath}",
18 | "args": ["--extensionDevelopmentPath=${workspaceFolder}"],
19 | "outFiles": ["${workspaceFolder}/out/extension.js"],
20 | "stopOnEntry": true,
21 | "showReturnValue": true,
22 | // "preLaunchTask": "npm: watch"
23 | },
24 | {
25 | "name": "Run Web Extension in VS Code",
26 | "type": "pwa-extensionHost",
27 | "debugWebWorkerHost": true,
28 | "request": "launch",
29 | "args": [
30 | "--extensionDevelopmentPath=${workspaceFolder}",
31 | "--extensionDevelopmentKind=web"
32 | ],
33 | "outFiles": ["${workspaceFolder}/dist/**/*.*"],
34 | "preLaunchTask": "npm: watch"
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/karavan-vscode/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "2.0.0",
3 | "tasks": [
4 | {
5 | "type": "npm",
6 | "script": "watch",
7 | "problemMatcher": "$tsc-watch",
8 | "isBackground": true,
9 | "presentation": {
10 | "reveal": "never"
11 | },
12 | "group": {
13 | "kind": "build",
14 | "isDefault": true
15 | }
16 | },
17 | {
18 | "type": "npm",
19 | "script": "watch-web",
20 | "group": "build",
21 | "isBackground": true,
22 | "problemMatcher": ["$ts-webpack-watch"]
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/karavan-vscode/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | out/**
4 | node_modules/**
5 | src/**
6 | .gitignore
7 | .yarnrc
8 | vsc-extension-quickstart.md
9 | **/tsconfig.json
10 | **/.eslintrc.json
11 | **/*.map
12 | **/*.ts
13 | dist/prerender.js
14 | dist/*.prerender.js
15 | dist/*.prerender.js.*
16 |
--------------------------------------------------------------------------------
/karavan-vscode/icons/karavan.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/icons/karavan.png
--------------------------------------------------------------------------------
/karavan-vscode/icons/run-jbang.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/icons/run-jbang.png
--------------------------------------------------------------------------------
/karavan-vscode/icons/run.svg:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/karavan-vscode/images/create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/images/create.png
--------------------------------------------------------------------------------
/karavan-vscode/images/export.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/images/export.png
--------------------------------------------------------------------------------
/karavan-vscode/images/install.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/images/install.png
--------------------------------------------------------------------------------
/karavan-vscode/images/karavan-vscode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/images/karavan-vscode.png
--------------------------------------------------------------------------------
/karavan-vscode/images/open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/images/open.png
--------------------------------------------------------------------------------
/karavan-vscode/images/run.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/camel-karavan/8bc3d54936935c70b0866b29f6f6db499bd25cf8/karavan-vscode/images/run.png
--------------------------------------------------------------------------------
/karavan-vscode/snippets/camel-main-org.apache.camel.AggregationStrategy.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.AggregationStrategy;
2 | import org.apache.camel.Configuration;
3 | import org.apache.camel.BindToRegistry;
4 | import org.apache.camel.Exchange;
5 |
6 | @Configuration
7 | @BindToRegistry("${NAME}")
8 | public class ${NAME} implements AggregationStrategy {
9 | @Override
10 | public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
11 |
12 | if (oldExchange == null) {
13 | return newExchange;
14 | }
15 |
16 | String oldBody = oldExchange.getIn().getBody(String.class);
17 | String newBody = newExchange.getIn().getBody(String.class);
18 | oldExchange.getIn().setBody(oldBody + "+" + newBody);
19 | return oldExchange;
20 | }
21 | }
--------------------------------------------------------------------------------
/karavan-vscode/snippets/camel-main-org.apache.camel.Processor.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.BindToRegistry;
2 | import org.apache.camel.Configuration;
3 | import org.apache.camel.Exchange;
4 | import org.apache.camel.Processor;
5 |
6 | @Configuration
7 | @BindToRegistry("${NAME}")
8 | public class ${NAME} implements Processor {
9 |
10 | public void process(Exchange exchange) throws Exception {
11 | exchange.getIn().setBody("Hello World");
12 | }
13 | }
--------------------------------------------------------------------------------
/karavan-vscode/snippets/quarkus-org.apache.camel.AggregationStrategy.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.AggregationStrategy
2 | ;
3 | import org.apache.camel.Exchange;
4 |
5 | import javax.inject.Named;
6 | import javax.inject.Singleton;
7 |
8 | @Singleton
9 | @Named("NAME")
10 | public class NAME implements AggregationStrategy {
11 | @Override
12 | public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
13 |
14 | if (oldExchange == null) {
15 | return newExchange;
16 | }
17 |
18 | String oldBody = oldExchange.getIn().getBody(String.class);
19 | String newBody = newExchange.getIn().getBody(String.class);
20 | oldExchange.getIn().setBody(oldBody + "+" + newBody);
21 | return oldExchange;
22 | }
23 | }
--------------------------------------------------------------------------------
/karavan-vscode/snippets/quarkus-org.apache.camel.Processor.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.Exchange;
2 | import org.apache.camel.Processor;
3 |
4 | import javax.inject.Named;
5 | import javax.inject.Singleton;
6 |
7 | @Singleton
8 | @Named("NAME")
9 | public class NAME implements Processor {
10 |
11 | public void process(Exchange exchange) throws Exception {
12 | exchange.getIn().setBody("Hello World");
13 | }
14 | }
--------------------------------------------------------------------------------
/karavan-vscode/snippets/spring-boot-org.apache.camel.AggregationStrategy.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.AggregationStrategy;
2 | import org.apache.camel.Exchange;
3 |
4 | import org.springframework.stereotype.Component;
5 |
6 | @Component("NAME")
7 | public class NAME implements AggregationStrategy {
8 | @Override
9 | public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
10 |
11 | if (oldExchange == null) {
12 | return newExchange;
13 | }
14 |
15 | String oldBody = oldExchange.getIn().getBody(String.class);
16 | String newBody = newExchange.getIn().getBody(String.class);
17 | oldExchange.getIn().setBody(oldBody + "+" + newBody);
18 | return oldExchange;
19 | }
20 | }
--------------------------------------------------------------------------------
/karavan-vscode/snippets/spring-boot-org.apache.camel.Processor.java:
--------------------------------------------------------------------------------
1 | import org.apache.camel.Exchange;
2 | import org.apache.camel.Processor;
3 |
4 | import org.springframework.stereotype.Component;
5 |
6 | @Component("NAME")
7 | public class NAME implements Processor {
8 |
9 | public void process(Exchange exchange) throws Exception {
10 | exchange.getIn().setBody("Hello World");
11 | }
12 | }
--------------------------------------------------------------------------------
/karavan-vscode/src/maven.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | export function createPackageAndPushImageCommand(directory: string) {
19 | return "mvn clean package -f " + directory
20 | + " -Dquarkus.kubernetes.deploy=false"
21 | + " -Dquarkus.container-image.build=true -Dquarkus.container-image.push=true"
22 | }
23 |
24 | export function createPackageAndDeployCommand(directory: string) {
25 | return "mvn clean package -f " + directory
26 | + " -Dquarkus.kubernetes.deploy=true -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000"
27 | + " -Dquarkus.container-image.build=false -Dquarkus.container-image.push=false"
28 | }
29 |
30 |
31 |
--------------------------------------------------------------------------------
/karavan-vscode/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "rootDir": ".",
5 | "outDir": "dist",
6 | "module": "esnext",
7 | "target": "es2022",
8 | "lib": [
9 | "dom",
10 | "dom.iterable",
11 | "esnext",
12 | "es2022"
13 | ],
14 | "sourceMap": true,
15 | "jsx": "react",
16 | "moduleResolution": "node",
17 | "forceConsistentCasingInFileNames": true,
18 | "noImplicitReturns": false,
19 | "noImplicitThis": true,
20 | "noImplicitAny": false,
21 | "allowJs": true,
22 | "esModuleInterop": true,
23 | "allowSyntheticDefaultImports": true,
24 | "strict": true,
25 | "paths": {
26 | "@app/*": ["src/app/*"],
27 | "@assets/*": ["node_modules/@patternfly/react-core/dist/styles/assets/*"],
28 | "core": ["webview/core"]
29 | },
30 | "importHelpers": true,
31 | "skipLibCheck": true
32 | },
33 | "include": [
34 | "**/*.ts",
35 | "**/*.tsx",
36 | "**/*.jsx",
37 | "**/*.js"
38 | ],
39 | "exclude": ["node_modules", ".vscode-test"]
40 | }
41 |
--------------------------------------------------------------------------------
/karavan-vscode/webview/App.css:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | contributor license agreements. See the NOTICE file distributed with
3 | this work for additional information regarding copyright ownership.
4 | The ASF licenses this file to You under the Apache License, Version 2.0
5 | (the "License"); you may not use this file except in compliance with
6 | the License. You may obtain a copy of the License at
7 |
8 | http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | Unless required by applicable law or agreed to in writing, software
11 | distributed under the License is distributed on an "AS IS" BASIS,
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | See the License for the specific language governing permissions and
14 | limitations under the License. */
15 |
16 | .App {
17 | background-color: var(--background);
18 | }
19 |
--------------------------------------------------------------------------------
/karavan-vscode/webview/acquireVsCodeApi.d.ts:
--------------------------------------------------------------------------------
1 | // Licensed to the Apache Software Foundation (ASF) under one or more
2 | // contributor license agreements. See the NOTICE file distributed with
3 | // this work for additional information regarding copyright ownership.
4 | // The ASF licenses this file to You under the Apache License, Version 2.0
5 | // (the "License"); you may not use this file except in compliance with
6 | // the License. You may obtain a copy of the License at
7 |
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | declare var acquireVsCodeApi: any;
17 |
--------------------------------------------------------------------------------
/karavan-vscode/webview/index.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import * as React from "react";
18 | import {createRoot} from "react-dom/client";
19 | import App from "./App";
20 | import "./index.css";
21 | import "@patternfly/patternfly/patternfly.css";
22 |
23 | const dark = document.body.className.includes('vscode-dark');
24 | const container = document.getElementById('root');
25 | const root = createRoot(container!);
26 | root.render();
27 |
--------------------------------------------------------------------------------
/karavan-vscode/webview/prerender.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | import * as React from "react";
18 | import { renderToString } from "react-dom/server";
19 | import App from "./App";
20 |
21 | export default () => {
22 | const html = renderToString();
23 |
24 | return `
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
${html}
35 |
37 |
38 |
39 |
40 | `;
41 | };
42 |
--------------------------------------------------------------------------------
/karavan-vscode/webview/topology/CustomEdge.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import * as React from 'react';
19 |
20 | import './topology.css';
21 | import {DefaultEdge, observer} from '@patternfly/react-topology';
22 |
23 |
24 | const CustomEdge: React.FC = observer(({ element, ...rest }) => {
25 | return (
26 |
27 |
28 | )
29 | })
30 | export default CustomEdge;
--------------------------------------------------------------------------------
/karavan-vscode/webview/topology/CustomGroup.tsx:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | import * as React from 'react';
19 |
20 | import './topology.css';
21 | import {DefaultGroup, LabelPosition, observer} from '@patternfly/react-topology';
22 |
23 | const CustomGroup: React.FC = observer(({ element, ...rest }) => {
24 | return (
25 |
32 |
33 | )
34 | })
35 | export default CustomGroup;
--------------------------------------------------------------------------------
/karavan-vscode/webview/vscode.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | let vscode;
18 | if (typeof acquireVsCodeApi !== "undefined") {
19 | vscode = acquireVsCodeApi();
20 | }
21 |
22 | export default vscode;
23 |
--------------------------------------------------------------------------------
/release-utils/prerelease.sh:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 |
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | set -e
17 |
18 | if [ "$#" -lt 1 ]; then
19 | echo "usage: $0 version"
20 | exit 1
21 | fi
22 |
23 | location=$(dirname $0)
24 | version=$1
25 |
26 | mkdir $1/
27 | cd $1/
28 |
29 | wget https://github.com/apache/camel-karavan/releases/download/$1/camel-karavan-$1.zip
30 | wget https://github.com/apache/camel-karavan/releases/download/$1/camel-karavan-$1.zip.asc
31 | wget https://github.com/apache/camel-karavan/releases/download/$1/camel-karavan-$1.zip.sha512
32 | cd ../
33 | svn import $1/ https://dist.apache.org/repos/dist/dev/camel/camel-karavan/$1/ -m "Import camel-karavan release"
34 | rm -rf $1/
--------------------------------------------------------------------------------
/release-utils/release.sh:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more
2 | # contributor license agreements. See the NOTICE file distributed with
3 | # this work for additional information regarding copyright ownership.
4 | # The ASF licenses this file to You under the Apache License, Version 2.0
5 | # (the "License"); you may not use this file except in compliance with
6 | # the License. You may obtain a copy of the License at
7 |
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 |
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | set -e
17 |
18 | if [ "$#" -lt 1 ]; then
19 | echo "usage: $0 version"
20 | exit 1
21 | fi
22 |
23 | location=$(dirname $0)
24 | version=$1
25 |
26 | mkdir $1/
27 | cd $1/
28 |
29 | wget https://dist.apache.org/repos/dist/dev/camel/camel-karavan/$1/camel-karavan-$1.zip
30 | wget https://dist.apache.org/repos/dist/dev/camel/camel-karavan/$1/camel-karavan-$1.zip.asc
31 | wget https://dist.apache.org/repos/dist/dev/camel/camel-karavan/$1/camel-karavan-$1.zip.sha512
32 | cd ../
33 | svn import $1/ https://dist.apache.org/repos/dist/release/camel/camel-karavan/$1/ -m "Import camel-karavan release"
34 |
35 | rm -rf $1/
--------------------------------------------------------------------------------