karavan-core 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/.bebelrc +3 -0
  2. package/.mocharc.json +11 -0
  3. package/.prettierignore +9 -0
  4. package/.prettierrc +14 -0
  5. package/package.json +62 -0
  6. package/src/core/api/CamelDefinitionApi.ts +3271 -0
  7. package/src/core/api/CamelDefinitionApiExt.ts +757 -0
  8. package/src/core/api/CamelDefinitionYaml.ts +412 -0
  9. package/src/core/api/CamelDefinitionYamlStep.ts +4733 -0
  10. package/src/core/api/CamelDisplayUtil.ts +143 -0
  11. package/src/core/api/CamelUtil.ts +360 -0
  12. package/src/core/api/ComponentApi.ts +368 -0
  13. package/src/core/api/KameletApi.ts +147 -0
  14. package/src/core/api/MainConfigurationApi.ts +47 -0
  15. package/src/core/api/ProjectModelApi.ts +75 -0
  16. package/src/core/api/SpiBeanApi.ts +104 -0
  17. package/src/core/api/TemplateApi.ts +58 -0
  18. package/src/core/api/TopologyUtils.ts +392 -0
  19. package/src/core/api/VariableUtil.ts +104 -0
  20. package/src/core/model/CamelDefinition.ts +3783 -0
  21. package/src/core/model/CamelMetadata.ts +2714 -0
  22. package/src/core/model/ComponentModels.ts +106 -0
  23. package/src/core/model/IntegrationDefinition.ts +188 -0
  24. package/src/core/model/KameletModels.ts +223 -0
  25. package/src/core/model/MainConfigurationModel.ts +37 -0
  26. package/src/core/model/ProjectModel.ts +43 -0
  27. package/src/core/model/SpiBeanModels.ts +53 -0
  28. package/src/core/model/TopologyDefinition.ts +117 -0
  29. package/test/addStep.spec.ts +124 -0
  30. package/test/addStep1.yaml +27 -0
  31. package/test/allowableValues.camel.yaml +19 -0
  32. package/test/allowableValues.spec.ts +30 -0
  33. package/test/avro-serialize-action.kamelet.yaml +70 -0
  34. package/test/beans.spec.ts +92 -0
  35. package/test/beans1.yaml +36 -0
  36. package/test/beans2.yaml +42 -0
  37. package/test/beans3.yaml +7 -0
  38. package/test/checkRequired.spec.ts +53 -0
  39. package/test/circuitBreaker.spec.ts +57 -0
  40. package/test/circuitBreaker.yaml +19 -0
  41. package/test/cloneDefinition.spec.ts +106 -0
  42. package/test/createKamelet.spec.ts +38 -0
  43. package/test/cxf.json +615 -0
  44. package/test/cxf.spec.ts +44 -0
  45. package/test/cxf.yaml +15 -0
  46. package/test/deleteStep.spec.ts +74 -0
  47. package/test/demo.spec.ts +49 -0
  48. package/test/demo.yaml +32 -0
  49. package/test/doCatchOnWhen.camel.yaml +20 -0
  50. package/test/doCatchOnWhen.spec.ts +36 -0
  51. package/test/errorHandler.spec.ts +38 -0
  52. package/test/errorHandler1.yaml +27 -0
  53. package/test/expression.spec.ts +55 -0
  54. package/test/findStep.spec.ts +112 -0
  55. package/test/findStep.yaml +65 -0
  56. package/test/getElementProperties.spec.ts +32 -0
  57. package/test/getElementPropertiesByName.spec.ts +31 -0
  58. package/test/getExpressionLanguage.spec.ts +40 -0
  59. package/test/hasElementWithId.camel.yaml +98 -0
  60. package/test/hasElementWithId.spec.ts +57 -0
  61. package/test/hasElementWithId1.camel.yaml +16 -0
  62. package/test/hasElementWithIdError.camel.yaml +98 -0
  63. package/test/integration.spec.ts +60 -0
  64. package/test/integration1.yaml +24 -0
  65. package/test/integration2.yaml +23 -0
  66. package/test/integrationToYaml.spec.ts +51 -0
  67. package/test/intercept.spec.ts +62 -0
  68. package/test/intercept.yaml +19 -0
  69. package/test/is-not-integration.yaml +5114 -0
  70. package/test/isIntegration.spec.ts +45 -0
  71. package/test/kamelet.spec.ts +61 -0
  72. package/test/metadata/components.json +697 -0
  73. package/test/metadata/kamelets.yaml +23414 -0
  74. package/test/metadata/spiBeans.json +3094 -0
  75. package/test/multiObjectProperties.spec.ts +46 -0
  76. package/test/multiObjectProperties1.yaml +19 -0
  77. package/test/multiple.spec.ts +38 -0
  78. package/test/multiple.yaml +29 -0
  79. package/test/openapi.spec.ts +48 -0
  80. package/test/openapi.yaml +7 -0
  81. package/test/placeholder.spec.ts +32 -0
  82. package/test/placeholder.yaml +133 -0
  83. package/test/plain-try-catch.yaml +31 -0
  84. package/test/plain.spec.ts +72 -0
  85. package/test/plain1.yaml +22 -0
  86. package/test/plain2.yaml +13 -0
  87. package/test/plain3.yaml +5 -0
  88. package/test/plain4.yaml +5 -0
  89. package/test/postgresql-source.kamelet.yaml +113 -0
  90. package/test/restConfigDsl.yaml +15 -0
  91. package/test/restDsl.spec.ts +83 -0
  92. package/test/restDsl.yaml +29 -0
  93. package/test/routes.spec.ts +37 -0
  94. package/test/routes1.yaml +31 -0
  95. package/test/supported-components.json +1221 -0
  96. package/test/supportedComponents.spec.ts +34 -0
  97. package/test/template1.AggregationStrategy.java +21 -0
  98. package/test/template1.Processor.java +13 -0
  99. package/test/template2.AggregationStrategy.java +21 -0
  100. package/test/template2.Processor.java +13 -0
  101. package/test/templateApi.spec.ts +45 -0
  102. package/test/timer-source.kamelet.yaml +75 -0
  103. package/test/tod.spec.ts +31 -0
  104. package/test/tod.yaml +9 -0
  105. package/test/topology.spec.ts +51 -0
  106. package/test/topology1.camel.yaml +56 -0
  107. package/test/topology2.camel.yaml +44 -0
  108. package/test/topology3.camel.yaml +27 -0
  109. package/test/tsconfig.testing.json +14 -0
  110. package/test/updateStep.spec.ts +72 -0
  111. package/test/variable1.camel.yaml +42 -0
  112. package/test/variable2.camel.yaml +42 -0
  113. package/test/variables.spec.ts +34 -0
  114. package/tsconfig.json +34 -0
@@ -0,0 +1,98 @@
1
+ - rest:
2
+ id: rest-328e
3
+ description: >-
4
+ It has a broken design for long endpoint descriptions and a dual topology
5
+ view rendering
6
+ get:
7
+ - id: get-5ab7
8
+ to: direct:hello
9
+ - route:
10
+ id: route-0dc7
11
+ description: Audit Start
12
+ nodePrefixId: route-972
13
+ from:
14
+ id: from-846a
15
+ description: Audit Start
16
+ uri: direct
17
+ parameters:
18
+ name: start
19
+ steps:
20
+ - to:
21
+ id: to-3597
22
+ uri: kafka
23
+ parameters:
24
+ topic: audit
25
+ - route:
26
+ id: route-a54e
27
+ description: Audit Finish
28
+ nodePrefixId: route-1d1
29
+ from:
30
+ id: from-47d5
31
+ description: Audit Finish
32
+ uri: direct
33
+ parameters:
34
+ name: finish
35
+ steps:
36
+ - to:
37
+ id: to-3cf2
38
+ uri: kafka
39
+ parameters:
40
+ topic: audit
41
+ - route:
42
+ id: route-07ed
43
+ description: Audit Step
44
+ nodePrefixId: route-833
45
+ from:
46
+ id: from-e007
47
+ uri: direct
48
+ parameters:
49
+ name: step
50
+ steps:
51
+ - to:
52
+ id: to-fa9e
53
+ uri: kafka
54
+ parameters:
55
+ topic: audit
56
+ - route:
57
+ id: hello
58
+ from:
59
+ id: from-3f49
60
+ uri: direct
61
+ parameters:
62
+ name: hello
63
+ steps:
64
+ - to:
65
+ id: to-428d
66
+ uri: activemq
67
+ - to:
68
+ id: to-fed7
69
+ uri: kafka
70
+ - routeConfiguration:
71
+ id: auditedRoute
72
+ intercept:
73
+ - intercept:
74
+ id: intercept-0deb
75
+ steps:
76
+ - to:
77
+ id: to-b470
78
+ uri: direct
79
+ parameters:
80
+ name: step
81
+ interceptFrom:
82
+ - interceptFrom:
83
+ id: interceptFrom-4041
84
+ steps:
85
+ - to:
86
+ id: to-6861
87
+ uri: direct
88
+ parameters:
89
+ name: start
90
+ onCompletion:
91
+ - onCompletion:
92
+ id: onCompletion-3dab
93
+ steps:
94
+ - to:
95
+ id: to-dd4e
96
+ uri: direct
97
+ parameters:
98
+ name: finish
@@ -0,0 +1,57 @@
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 {
20
+ FromDefinition,
21
+ LogDefinition,
22
+ WhenDefinition,
23
+ ChoiceDefinition,
24
+ MulticastDefinition,
25
+ ExpressionDefinition,
26
+ RouteDefinition, TryDefinition,CatchDefinition
27
+ } from "../src/core/model/CamelDefinition";
28
+ import {CamelDefinitionApiExt} from "../src/core/api/CamelDefinitionApiExt";
29
+ import {CamelDefinitionYaml} from "../src/core/api/CamelDefinitionYaml";
30
+ import {SimpleExpression} from "../src/core/model/CamelDefinition";
31
+ import {Integration} from "../src/core/model/IntegrationDefinition";
32
+ import * as fs from 'fs';
33
+
34
+ describe('Check for id duplicates', () => {
35
+
36
+ it('Check YAML OK', () => {
37
+ const yaml = fs.readFileSync('test/hasElementWithId.camel.yaml',{encoding:'utf8', flag:'r'});
38
+ const i1 = CamelDefinitionYaml.yamlToIntegration("hasElementWithId.camel.yaml", yaml);
39
+
40
+ expect(CamelDefinitionApiExt.hasElementWithId(i1, 'from-47d5')).to.equal(1);
41
+ });
42
+
43
+ it('Check YAML OK', () => {
44
+ const yaml = fs.readFileSync('test/hasElementWithId1.camel.yaml',{encoding:'utf8', flag:'r'});
45
+ const i1 = CamelDefinitionYaml.yamlToIntegration("hasElementWithId.camel.yaml", yaml);
46
+
47
+ expect(CamelDefinitionApiExt.hasElementWithId(i1, 'fhello-world')).to.equal(2);
48
+ });
49
+
50
+ it('Check YAML Error', () => {
51
+ const yaml = fs.readFileSync('test/hasElementWithIdError.camel.yaml', { encoding: 'utf8', flag: 'r' });
52
+ const i1 = CamelDefinitionYaml.yamlToIntegration('hasElementWithId.camel.yaml', yaml);
53
+
54
+ expect(CamelDefinitionApiExt.hasElementWithId(i1, 'from-47d5')).to.equal(2);
55
+ });
56
+
57
+ });
@@ -0,0 +1,16 @@
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
@@ -0,0 +1,98 @@
1
+ - rest:
2
+ id: rest-328e
3
+ description: >-
4
+ It has a broken design for long endpoint descriptions and a dual topology
5
+ view rendering
6
+ get:
7
+ - id: get-5ab7
8
+ to: direct:hello
9
+ - route:
10
+ id: route-0dc7
11
+ description: Audit Start
12
+ nodePrefixId: route-972
13
+ from:
14
+ id: from-47d5
15
+ description: Audit Start
16
+ uri: direct
17
+ parameters:
18
+ name: start
19
+ steps:
20
+ - to:
21
+ id: to-3597
22
+ uri: kafka
23
+ parameters:
24
+ topic: audit
25
+ - route:
26
+ id: route-a54e
27
+ description: Audit Finish
28
+ nodePrefixId: route-1d1
29
+ from:
30
+ id: from-47d5
31
+ description: Audit Finish
32
+ uri: direct
33
+ parameters:
34
+ name: finish
35
+ steps:
36
+ - to:
37
+ id: to-3cf2
38
+ uri: kafka
39
+ parameters:
40
+ topic: audit
41
+ - route:
42
+ id: route-07ed
43
+ description: Audit Step
44
+ nodePrefixId: route-833
45
+ from:
46
+ id: from-e007
47
+ uri: direct
48
+ parameters:
49
+ name: step
50
+ steps:
51
+ - to:
52
+ id: to-fa9e
53
+ uri: kafka
54
+ parameters:
55
+ topic: audit
56
+ - route:
57
+ id: hello
58
+ from:
59
+ id: from-3f49
60
+ uri: direct
61
+ parameters:
62
+ name: hello
63
+ steps:
64
+ - to:
65
+ id: to-428d
66
+ uri: activemq
67
+ - to:
68
+ id: to-fed7
69
+ uri: kafka
70
+ - routeConfiguration:
71
+ id: auditedRoute
72
+ intercept:
73
+ - intercept:
74
+ id: intercept-0deb
75
+ steps:
76
+ - to:
77
+ id: to-b470
78
+ uri: direct
79
+ parameters:
80
+ name: step
81
+ interceptFrom:
82
+ - interceptFrom:
83
+ id: interceptFrom-4041
84
+ steps:
85
+ - to:
86
+ id: to-6861
87
+ uri: direct
88
+ parameters:
89
+ name: start
90
+ onCompletion:
91
+ - onCompletion:
92
+ id: onCompletion-3dab
93
+ steps:
94
+ - to:
95
+ id: to-dd4e
96
+ uri: direct
97
+ parameters:
98
+ name: finish
@@ -0,0 +1,60 @@
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 {FilterDefinition, ToDefinition} from "../src/core/model/CamelDefinition";
22
+ import { RouteDefinition} from "../src/core/model/CamelDefinition";
23
+
24
+ describe('CRD YAML to Integration', () => {
25
+
26
+
27
+
28
+ it('YAML <-> Object 1', () => {
29
+ const yaml = fs.readFileSync('test/integration1.yaml',{encoding:'utf8', flag:'r'});
30
+ const i = CamelDefinitionYaml.yamlToIntegration("test1.yaml", yaml);
31
+ expect(i.metadata.name).to.equal('test1.yaml');
32
+ expect(i.kind).to.equal('Integration');
33
+ expect(i.spec.flows?.length).to.equal(1);
34
+ expect(i.type).to.equal('crd');
35
+ if (i.spec.flows){
36
+ const f:FilterDefinition = (i.spec.flows[0] as RouteDefinition).from.steps[1];
37
+ const t:ToDefinition = <ToDefinition> (f.steps ? f.steps[0] : undefined);
38
+ expect(t.uri).to.equal("log");
39
+ expect(t.parameters.level).to.equal("OFF");
40
+ }
41
+ console.log(CamelDefinitionYaml.integrationToYaml(i))
42
+ });
43
+
44
+ it('YAML <-> Object 2', () => {
45
+ const yaml = fs.readFileSync('test/integration2.yaml',{encoding:'utf8', flag:'r'});
46
+ const i = CamelDefinitionYaml.yamlToIntegration("test1.yaml", yaml);
47
+ expect(i.metadata.name).to.equal('test1.yaml');
48
+ expect(i.kind).to.equal('Integration');
49
+ expect(i.spec.flows?.length).to.equal(1);
50
+ expect(i.type).to.equal('crd');
51
+
52
+ if (i.spec.flows){
53
+ const f:FilterDefinition = (i.spec.flows[0] as RouteDefinition).from.steps[1];
54
+ const t:ToDefinition = <ToDefinition> (f.steps ? f.steps[0] : undefined);
55
+ expect(t.uri).to.equal("log");
56
+ expect(t.parameters.level).to.equal("OFF");
57
+ }
58
+ });
59
+
60
+ });
@@ -0,0 +1,24 @@
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
@@ -0,0 +1,23 @@
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
@@ -0,0 +1,51 @@
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 { BeanFactoryDefinition } from '../src/core/model/CamelDefinition';
22
+
23
+ describe('Integration to YAML', () => {
24
+
25
+ it('YAML <-> Object', () => {
26
+ const yaml = fs.readFileSync('test/avro-serialize-action.kamelet.yaml',{encoding:'utf8', flag:'r'});
27
+ const i = CamelDefinitionYaml.yamlToIntegration("avro-serialize-action.kamelet.yaml", yaml);
28
+ expect(i.metadata.name).to.equal('avro-serialize-action');
29
+ expect(i.kind).to.equal('Kamelet');
30
+ if (i.spec.flows?.[1]){
31
+ const b:BeanFactoryDefinition = (i.spec.flows?.[1].beans[0] as BeanFactoryDefinition);
32
+ expect(b.properties.validate).to.equal("{{validate}}");
33
+ expect(b.properties.schema).to.equal("{{schema:}}");
34
+ }
35
+ });
36
+
37
+ it('YAML <-> Object', () => {
38
+ const yaml = fs.readFileSync('test/postgresql-source.kamelet.yaml',{encoding:'utf8', flag:'r'});
39
+ const i = CamelDefinitionYaml.yamlToIntegration("postgresql-source.kamelet.yaml", yaml);
40
+ expect(i.metadata.name).to.equal('postgresql-source');
41
+ expect(i.kind).to.equal('Kamelet');
42
+ if (i.spec.flows?.[1]){
43
+ const b:BeanFactoryDefinition = (i.spec.flows?.[1].beans[0] as BeanFactoryDefinition);
44
+ expect(b.properties.username).to.equal("{{username}}");
45
+ expect(b.properties.password).to.equal("{{password}}");
46
+ expect(b.properties.url).to.equal("jdbc:postgresql://{{serverName}}:{{serverPort}}/{{databaseName}}");
47
+ expect(b.properties.driverClassName).to.equal("org.postgresql.Driver");
48
+ }
49
+ });
50
+
51
+ });
@@ -0,0 +1,62 @@
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 {
23
+ CatchDefinition,
24
+ ExpressionDefinition,
25
+ FromDefinition, LogDefinition,
26
+ PropertyExpressionDefinition
27
+ } from "../src/core/model/CamelDefinition";
28
+ import {expect} from "chai";
29
+ import {
30
+ InterceptDefinition,
31
+ RouteConfigurationDefinition,
32
+ RouteDefinition,
33
+ SagaDefinition,
34
+ ToDefinition,
35
+ TryDefinition
36
+ } from "../src/core/model/CamelDefinition";
37
+ import {Integration} from "../src/core/model/IntegrationDefinition";
38
+
39
+ describe('Intercept', () => {
40
+
41
+ it('Intercept YAML', () => {
42
+ // const yaml = fs.readFileSync('test/demo.yaml',{encoding:'utf8', flag:'r'});
43
+ // const i = CamelDefinitionYaml.yamlToIntegration("demo.yaml", yaml);
44
+ const i = Integration.createNew("intercept.camel", 'plain');
45
+
46
+ const intercept1 = new InterceptDefinition({
47
+ steps: [new LogDefinition({logName: 'log1', message: "intercept1"})]
48
+ })
49
+ const intercept2 = new InterceptDefinition({
50
+ steps: [new LogDefinition({logName: 'log2', message: "intercept2"})]
51
+ })
52
+ const routeConfiguration = new RouteConfigurationDefinition({
53
+ intercept: [intercept1, intercept2]
54
+ });
55
+ i.spec.flows?.push(routeConfiguration);
56
+
57
+ const yaml = CamelDefinitionYaml.integrationToYaml(i);
58
+
59
+ const i2 = CamelDefinitionYaml.yamlToIntegration("demo.yaml", yaml);
60
+ });
61
+
62
+ });
@@ -0,0 +1,19 @@
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