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,106 @@
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
+ export class ComponentTitle {
18
+ kind: string = '';
19
+ name: string = '';
20
+ title: string = '';
21
+ description: string = '';
22
+ deprecated: boolean = false;
23
+ firstVersion: string = '';
24
+ label: string = '';
25
+ javaType: string = '';
26
+ supportLevel: string = '';
27
+ supportType: string = '';
28
+ groupId: string = '';
29
+ artifactId: string = '';
30
+ version: string = '';
31
+ scheme: string = '';
32
+ extendsScheme: string = '';
33
+ syntax: string = '';
34
+ async: boolean = false;
35
+ api: boolean = false;
36
+ consumerOnly: boolean = false;
37
+ producerOnly: boolean = false;
38
+ lenientProperties: boolean = false;
39
+ componentProperties: any;
40
+ remote: boolean = false;
41
+
42
+ public constructor(init?: Partial<ComponentTitle>) {
43
+ Object.assign(this, init);
44
+ }
45
+ }
46
+
47
+ export class ComponentHeader {
48
+ name: string = '';
49
+ index: number = 0;
50
+ kind: string = '';
51
+ displayName: string = '';
52
+ group: string = '';
53
+ label: boolean = false;
54
+ javaType: string = '';
55
+ deprecated: boolean = false;
56
+ deprecationNote: string = '';
57
+ defaultValue: string = '';
58
+ secret: boolean = false;
59
+ autowired: boolean = false;
60
+ description: string = '';
61
+ constantName: string = '';
62
+
63
+ public constructor(init?: Partial<ComponentHeader>) {
64
+ Object.assign(this, init);
65
+ }
66
+ }
67
+
68
+ export class Component {
69
+ component: ComponentTitle = new ComponentTitle();
70
+ properties: any;
71
+ headers: any;
72
+
73
+ public constructor(init?: Partial<Component>) {
74
+ Object.assign(this, init);
75
+ }
76
+ }
77
+
78
+ export class ComponentProperty {
79
+ name: string = '';
80
+ deprecated: boolean = false;
81
+ description: string = '';
82
+ displayName: string = '';
83
+ group: string = '';
84
+ kind: string = '';
85
+ label: string = '';
86
+ type: string = '';
87
+ secret: boolean = false;
88
+ enum: string[] = [];
89
+ required: boolean = false;
90
+ defaultValue: string | number | boolean | any;
91
+ value: string | any;
92
+
93
+ public constructor(init?: Partial<ComponentProperty>) {
94
+ Object.assign(this, init);
95
+ }
96
+ }
97
+
98
+ export class SupportedComponent {
99
+ name: string = '';
100
+ level: string = '';
101
+ native: boolean = false;
102
+
103
+ public constructor(init?: Partial<SupportedComponent>) {
104
+ Object.assign(this, init);
105
+ }
106
+ }
@@ -0,0 +1,188 @@
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
+ import { BeanFactoryDefinition } from './CamelDefinition';
19
+
20
+ export class IntegrationFile {
21
+ name: string = '';
22
+ code: string = '';
23
+
24
+ constructor(name: string, code: string) {
25
+ this.name = name;
26
+ this.code = code;
27
+ }
28
+ }
29
+
30
+ export class DefinitionProperty {
31
+ title: string = '';
32
+ description: string = '';
33
+ type: 'string' | 'integer' | 'boolean' = 'string';
34
+ default?: any;
35
+ example?: any;
36
+ format?: string;
37
+ "x-descriptors"?: string[];
38
+ enum?: string[];
39
+
40
+ public constructor(init?: Partial<DefinitionProperty>) {
41
+ Object.assign(this, init);
42
+ }
43
+ }
44
+
45
+ export class MediaType {
46
+ mediaType: string = '';
47
+
48
+ public constructor(init?: Partial<MediaType>) {
49
+ Object.assign(this, init);
50
+ }
51
+ }
52
+
53
+ export class Types {
54
+ in?: MediaType = new MediaType();
55
+ out?: MediaType = new MediaType();
56
+
57
+ public constructor(init?: Partial<Types>) {
58
+ Object.assign(this, init);
59
+ }
60
+ }
61
+
62
+ export class Definition {
63
+ title: string = '';
64
+ description: string = '';
65
+ required: string[] = [];
66
+ type: string = 'object';
67
+ properties: any = {};
68
+
69
+ public constructor(init?: Partial<Definition>) {
70
+ Object.assign(this, init);
71
+ }
72
+ }
73
+
74
+ export class Spec {
75
+ definition?: Definition;
76
+ types?: Types;
77
+ flows?: any[] = [];
78
+ template?: any;
79
+ dependencies?: string[];
80
+
81
+ public constructor(init?: Partial<Spec>) {
82
+ Object.assign(this, init);
83
+ }
84
+ }
85
+
86
+ export type KameletTypes = "sink" | "source" | "action";
87
+
88
+ export class MetadataLabels {
89
+ "camel.apache.org/kamelet.type": KameletTypes = 'source'
90
+
91
+ public constructor(init?: Partial<MetadataLabels>) {
92
+ Object.assign(this, init);
93
+ }
94
+ }
95
+
96
+ export class MetadataAnnotations {
97
+ "camel.apache.org/kamelet.support.level": string = 'Preview';
98
+ "camel.apache.org/catalog.version": string = '';
99
+ "camel.apache.org/kamelet.icon": string = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23000000' viewBox='0 0 32 32' id='icon'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:none;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3Eapplication%3C/title%3E%3Cpath d='M16,18H6a2,2,0,0,1-2-2V6A2,2,0,0,1,6,4H16a2,2,0,0,1,2,2V16A2,2,0,0,1,16,18ZM6,6V16H16V6Z' transform='translate(0 0)'/%3E%3Cpath d='M26,12v4H22V12h4m0-2H22a2,2,0,0,0-2,2v4a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V12a2,2,0,0,0-2-2Z' transform='translate(0 0)'/%3E%3Cpath d='M26,22v4H22V22h4m0-2H22a2,2,0,0,0-2,2v4a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V22a2,2,0,0,0-2-2Z' transform='translate(0 0)'/%3E%3Cpath d='M16,22v4H12V22h4m0-2H12a2,2,0,0,0-2,2v4a2,2,0,0,0,2,2h4a2,2,0,0,0,2-2V22a2,2,0,0,0-2-2Z' transform='translate(0 0)'/%3E%3Cg id='_Transparent_Rectangle_' data-name='&lt;Transparent Rectangle&gt;'%3E%3Crect class='cls-1' width='32' height='32'/%3E%3C/g%3E%3C/svg%3E";
100
+ "camel.apache.org/provider": string = 'Custom';
101
+ "camel.apache.org/kamelet.group": string = '';
102
+ "camel.apache.org/kamelet.namespace": string = '';
103
+
104
+ public constructor(init?: Partial<MetadataAnnotations>) {
105
+ Object.assign(this, init);
106
+ }
107
+ }
108
+
109
+ export class Metadata {
110
+ name: string = '';
111
+ annotations?: MetadataAnnotations;
112
+ labels?: MetadataLabels;
113
+
114
+ public constructor(init?: Partial<Metadata>) {
115
+ Object.assign(this, init);
116
+ }
117
+ }
118
+
119
+ export class Integration {
120
+ apiVersion: string = 'camel.apache.org/v1';
121
+ kind: string = 'Integration' || 'Kamelet';
122
+ metadata: Metadata = new Metadata();
123
+ spec: Spec = new Spec();
124
+ type: 'crd' | 'plain' | 'kamelet' = 'crd';
125
+
126
+ public constructor(init?: Partial<Integration>) {
127
+ Object.assign(this, init);
128
+ }
129
+
130
+ static createNew(name?: string, type: 'crd' | 'plain' | 'kamelet' = 'plain'): Integration {
131
+ const i = new Integration({ type: type,
132
+ metadata: new Metadata({ name: name }),
133
+ kind : type === 'kamelet' ? 'Kamelet' : 'Integration',
134
+ spec: new Spec({ flows: [] }) });
135
+
136
+ if (type === 'kamelet') {
137
+ i.metadata.annotations = new MetadataAnnotations({})
138
+ i.spec.definition = new Definition({})
139
+ i.spec.types = new Types();
140
+ }
141
+
142
+ return i;
143
+ }
144
+ }
145
+
146
+ export class CamelElement {
147
+ uuid: string = '';
148
+ dslName: string = '';
149
+ showChildren: boolean = true;
150
+
151
+ constructor(dslName: string) {
152
+ this.uuid = uuidv4();
153
+ this.dslName = dslName;
154
+ }
155
+
156
+ hasId(): boolean {
157
+ return this.hasOwnProperty('id');
158
+ }
159
+
160
+ hasSteps(): boolean {
161
+ return this.hasOwnProperty('steps');
162
+ }
163
+
164
+ hasStepName(): boolean {
165
+ return this.hasOwnProperty('stepName');
166
+ }
167
+ }
168
+
169
+ export class Beans extends CamelElement {
170
+ beans: BeanFactoryDefinition[] = [];
171
+
172
+ public constructor(init?: Partial<Beans>) {
173
+ super('Beans');
174
+ Object.assign(this, init);
175
+ }
176
+ }
177
+
178
+ export class CamelElementMeta {
179
+ step?: CamelElement;
180
+ parentUuid?: string;
181
+ position: number = 0;
182
+
183
+ constructor(step?: CamelElement, parentUuid?: string, position: number = 0) {
184
+ this.step = step;
185
+ this.parentUuid = parentUuid;
186
+ this.position = position;
187
+ }
188
+ }
@@ -0,0 +1,223 @@
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
+ export class Property {
18
+ id: string = '';
19
+ title: string = '';
20
+ description: string = '';
21
+ type: string = '';
22
+ default: string = '';
23
+ format: string = '';
24
+ example: string = '';
25
+ 'x-descriptors': string = '';
26
+ value: string | number | boolean = '';
27
+ enum?: string[];
28
+ }
29
+
30
+ export class Definition {
31
+ title: string = '';
32
+ description: string = '';
33
+ required: string[] = [];
34
+ properties: any = {};
35
+
36
+ public constructor(init?: Partial<Definition>) {
37
+ Object.assign(this, init);
38
+ }
39
+ }
40
+
41
+ export class KameletSpec {
42
+ definition: Definition = new Definition();
43
+ types: any = {};
44
+ flow: any = {};
45
+
46
+ public constructor(init?: Partial<KameletSpec>) {
47
+ Object.assign(this, init);
48
+ }
49
+ }
50
+
51
+ export class Labels {
52
+ 'camel.apache.org/kamelet.type': "sink" | "source" | "action" = 'source';
53
+
54
+ public constructor(init?: Partial<Labels>) {
55
+ Object.assign(this, init);
56
+ }
57
+ }
58
+
59
+ export class Annotations {
60
+ 'camel.apache.org/kamelet.icon': string | any = '';
61
+ 'camel.apache.org/catalog.version': string | any = '';
62
+ 'camel.apache.org/kamelet.support.level': string | any = '';
63
+
64
+ public constructor(init?: Partial<Annotations>) {
65
+ Object.assign(this, init);
66
+ }
67
+ }
68
+
69
+ export class KameletMetadata {
70
+ name: string = '';
71
+ labels: Labels = new Labels();
72
+ annotations: Annotations = new Annotations();
73
+
74
+ public constructor(init?: Partial<KameletMetadata>) {
75
+ Object.assign(this, init);
76
+ }
77
+ }
78
+
79
+ export class KameletModel {
80
+ apiVersion: string = 'camel.apache.org/v1alpha1';
81
+ kind: string = 'Kamelet';
82
+ metadata: KameletMetadata = new KameletMetadata();
83
+ spec: KameletSpec = new KameletSpec();
84
+
85
+ public constructor(init?: Partial<KameletModel>) {
86
+ Object.assign(this, init);
87
+ }
88
+
89
+ type(): string {
90
+ return this.metadata.labels['camel.apache.org/kamelet.type'] || '';
91
+ }
92
+
93
+ icon(): string {
94
+ return this.metadata.annotations['camel.apache.org/kamelet.icon'] || '';
95
+ }
96
+
97
+ version(): string {
98
+ return this.metadata.annotations['camel.apache.org/catalog.version'] || '';
99
+ }
100
+
101
+ title(): string {
102
+ return this.spec.definition.title;
103
+ }
104
+
105
+ description(): string {
106
+ return this.spec.definition.description;
107
+ }
108
+
109
+ properties(): any {
110
+ return this.spec.definition.properties;
111
+ }
112
+
113
+ static default = (): KameletModel[] => defaultKamelets;
114
+ }
115
+
116
+ const defaultKamelets: KameletModel[] = [
117
+ new KameletModel({
118
+ kind: 'uri',
119
+ apiVersion: '',
120
+ metadata: new KameletMetadata({
121
+ name: 'uri-source',
122
+ labels: new Labels({ 'camel.apache.org/kamelet.type': 'source' }),
123
+ annotations: new Annotations({
124
+ 'camel.apache.org/kamelet.icon':
125
+ "data:image/svg+xml,%3Csvg viewBox='0 0 130.21 130.01' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='333.48' x2='477' y1='702.6' y2='563.73' gradientTransform='translate(94.038 276.06) scale(.99206)' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23F69923' offset='0'/%3E%3Cstop stop-color='%23F79A23' offset='.11'/%3E%3Cstop stop-color='%23E97826' offset='.945'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='333.48' x2='477' y1='702.6' y2='563.73' gradientTransform='translate(94.038 276.06) scale(.99206)' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23F69923' offset='0'/%3E%3Cstop stop-color='%23F79A23' offset='.08'/%3E%3Cstop stop-color='%23E97826' offset='.419'/%3E%3C/linearGradient%3E%3ClinearGradient id='c' x1='633.55' x2='566.47' y1='814.6' y2='909.12' gradientTransform='translate(-85.421 56.236)' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23f6e423' offset='0'/%3E%3Cstop stop-color='%23F79A23' offset='.412'/%3E%3Cstop stop-color='%23E97826' offset='.733'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(-437.89 -835.29)'%3E%3Ccircle cx='503.1' cy='900.29' r='62.52' fill='url(%23a)' stroke='url(%23b)' stroke-linejoin='round' stroke-width='4.96'/%3E%3Cpath d='M487.89 873.64a89.53 89.53 0 0 0-2.688.031c-1.043.031-2.445.362-4.062.906 27.309 20.737 37.127 58.146 20.25 90.656.573.015 1.142.063 1.719.063 30.844 0 56.62-21.493 63.28-50.312-19.572-22.943-46.117-41.294-78.5-41.344z' fill='url(%23c)' opacity='.75'/%3E%3Cpath d='M481.14 874.58c-9.068 3.052-26.368 13.802-43 28.156 1.263 34.195 28.961 61.607 63.25 62.5 16.877-32.51 7.06-69.919-20.25-90.656z' fill='%2328170b' opacity='.75'/%3E%3Cpath d='M504.889 862.546c-.472-.032-.932.028-1.375.25-5.6 2.801 0 14 0 14-16.807 14.009-13.236 37.938-32.844 37.938-10.689 0-21.322-12.293-32.531-19.812-.144 1.773-.25 3.564-.25 5.375 0 24.515 13.51 45.863 33.469 57.063 5.583-.703 11.158-2.114 15.344-4.906 21.992-14.662 27.452-42.557 36.438-56.031 5.596-8.407 31.824-7.677 33.594-11.22 2.804-5.601-5.602-14-8.406-14h-22.406c-1.566 0-4.025-2.78-5.594-2.78h-8.406s-3.725-5.65-7.031-5.875z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E",
126
+ }),
127
+ }),
128
+ spec: new KameletSpec({ definition: new Definition({ title: 'URI source' }) }),
129
+ }),
130
+ new KameletModel({
131
+ kind: 'uri',
132
+ apiVersion: '',
133
+ metadata: new KameletMetadata({
134
+ name: 'uri-sink',
135
+ labels: new Labels({ 'camel.apache.org/kamelet.type': 'sink' }),
136
+ annotations: new Annotations({
137
+ 'camel.apache.org/kamelet.icon':
138
+ "data:image/svg+xml,%3Csvg viewBox='0 0 130.21 130.01' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='a' x1='333.48' x2='477' y1='702.6' y2='563.73' gradientTransform='translate(94.038 276.06) scale(.99206)' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23F69923' offset='0'/%3E%3Cstop stop-color='%23F79A23' offset='.11'/%3E%3Cstop stop-color='%23E97826' offset='.945'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='333.48' x2='477' y1='702.6' y2='563.73' gradientTransform='translate(94.038 276.06) scale(.99206)' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23F69923' offset='0'/%3E%3Cstop stop-color='%23F79A23' offset='.08'/%3E%3Cstop stop-color='%23E97826' offset='.419'/%3E%3C/linearGradient%3E%3ClinearGradient id='c' x1='633.55' x2='566.47' y1='814.6' y2='909.12' gradientTransform='translate(-85.421 56.236)' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23f6e423' offset='0'/%3E%3Cstop stop-color='%23F79A23' offset='.412'/%3E%3Cstop stop-color='%23E97826' offset='.733'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg transform='translate(-437.89 -835.29)'%3E%3Ccircle cx='503.1' cy='900.29' r='62.52' fill='url(%23a)' stroke='url(%23b)' stroke-linejoin='round' stroke-width='4.96'/%3E%3Cpath d='M487.89 873.64a89.53 89.53 0 0 0-2.688.031c-1.043.031-2.445.362-4.062.906 27.309 20.737 37.127 58.146 20.25 90.656.573.015 1.142.063 1.719.063 30.844 0 56.62-21.493 63.28-50.312-19.572-22.943-46.117-41.294-78.5-41.344z' fill='url(%23c)' opacity='.75'/%3E%3Cpath d='M481.14 874.58c-9.068 3.052-26.368 13.802-43 28.156 1.263 34.195 28.961 61.607 63.25 62.5 16.877-32.51 7.06-69.919-20.25-90.656z' fill='%2328170b' opacity='.75'/%3E%3Cpath d='M504.889 862.546c-.472-.032-.932.028-1.375.25-5.6 2.801 0 14 0 14-16.807 14.009-13.236 37.938-32.844 37.938-10.689 0-21.322-12.293-32.531-19.812-.144 1.773-.25 3.564-.25 5.375 0 24.515 13.51 45.863 33.469 57.063 5.583-.703 11.158-2.114 15.344-4.906 21.992-14.662 27.452-42.557 36.438-56.031 5.596-8.407 31.824-7.677 33.594-11.22 2.804-5.601-5.602-14-8.406-14h-22.406c-1.566 0-4.025-2.78-5.594-2.78h-8.406s-3.725-5.65-7.031-5.875z' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E",
139
+ }),
140
+ }),
141
+ spec: new KameletSpec({ definition: new Definition({ title: 'URI sink' }) }),
142
+ }),
143
+ ];
144
+
145
+ // KameletBinding data model
146
+ export class Ref {
147
+ apiVersion: string = 'camel.apache.org/v1alpha1';
148
+ kind: string = 'Kamelet';
149
+ name: string = '';
150
+ }
151
+
152
+ export class Source {
153
+ uri: string | any;
154
+ ref: Ref | any = new Ref();
155
+ properties: [] | any;
156
+
157
+ static createUri(uri: string) {
158
+ const source: Source = new Source();
159
+ source.uri = uri;
160
+ delete source.ref;
161
+ delete source.properties;
162
+ return source;
163
+ }
164
+
165
+ static createRef(refName: string) {
166
+ const source: Source = new Source();
167
+ source.ref.name = refName;
168
+ delete source.uri;
169
+ return source;
170
+ }
171
+ }
172
+
173
+ export class Sink {
174
+ uri: string | any;
175
+ ref: Ref | any = new Ref();
176
+ properties: [] | any;
177
+
178
+ static createUri(uri: string) {
179
+ const source: Sink = new Sink();
180
+ source.uri = uri;
181
+ delete source.ref;
182
+ delete source.properties;
183
+ return source;
184
+ }
185
+
186
+ static createRef(refName: string) {
187
+ const source: Sink = new Sink();
188
+ source.ref.name = refName;
189
+ delete source.uri;
190
+ return source;
191
+ }
192
+ }
193
+
194
+ export class Step {
195
+ ref: Ref = new Ref();
196
+ properties: any;
197
+ }
198
+
199
+ export class KameletBindingSpec {
200
+ source: Source = new Source();
201
+ steps: Step[] | any = [];
202
+ sink: Sink = new Sink();
203
+ }
204
+
205
+ export class KameletBindingAnnotations {
206
+ 'camel.apache.org/karavan.title': string = '';
207
+ }
208
+
209
+ export class KameletBindingMetadata {
210
+ name: string = '';
211
+ annotations: KameletBindingAnnotations | any = new KameletBindingAnnotations();
212
+ }
213
+
214
+ export class KameletBinding {
215
+ apiVersion: string = 'camel.apache.org/v1alpha1';
216
+ kind: string = 'KameletBinding';
217
+ metadata: KameletBindingMetadata = new KameletBindingMetadata();
218
+ spec: KameletBindingSpec = new KameletBindingSpec();
219
+
220
+ public constructor(init?: Partial<KameletBinding>) {
221
+ Object.assign(this, init);
222
+ }
223
+ }
@@ -0,0 +1,37 @@
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<ApplicationProperty>) {
26
+ Object.assign(this, init);
27
+ }
28
+ }
29
+
30
+ export class ApplicationPropertyGroup {
31
+ name: string = '';
32
+ description?: string;
33
+
34
+ public constructor(init?: Partial<ApplicationPropertyGroup>) {
35
+ Object.assign(this, init);
36
+ }
37
+ }
@@ -0,0 +1,43 @@
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<ProjectProperty>) {
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<ProjectModel>) {
37
+ Object.assign(this, init);
38
+ }
39
+
40
+ static createNew(init?: Partial<ProjectModel>): ProjectModel {
41
+ return new ProjectModel(init ? init : {});
42
+ }
43
+ }
@@ -0,0 +1,53 @@
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 SpiBeanProperty {
19
+ name?: string;
20
+ index: number = 0;
21
+ kind?: string;
22
+ displayName?: string;
23
+ required: boolean = false;
24
+ type?: string;
25
+ javaType?: string;
26
+ deprecated: boolean = false;
27
+ autowired: boolean = false;
28
+ secret: boolean = false;
29
+ defaultValue?: string;
30
+ description?: string;
31
+
32
+ public constructor(init?: Partial<SpiBeanProperty>) {
33
+ Object.assign(this, init);
34
+ }
35
+ }
36
+
37
+ export class SpiBean {
38
+ kind?: string;
39
+ name?: string;
40
+ javaType?: string;
41
+ interfaceType?: string;
42
+ title?: string;
43
+ description?: string;
44
+ deprecated?: string;
45
+ groupId?: string;
46
+ artifactId?: string;
47
+ version?: string;
48
+ properties: any;
49
+
50
+ public constructor(init?: Partial<SpiBean>) {
51
+ Object.assign(this, init);
52
+ }
53
+ }