From 237a03896bcecb97bf99243daa248e0e9fc9d7a6 Mon Sep 17 00:00:00 2001 From: Lars Heinemann Date: Tue, 21 Nov 2023 14:20:16 +0100 Subject: [PATCH 1/4] added new icon for setHeaders EIP coming with Camel 4.3 (fixed #380) --- packages/ui/src/assets/eip/setheaders.png | Bin 0 -> 14476 bytes packages/ui/src/utils/node-icon-resolver.ts | 3 +++ 2 files changed, 3 insertions(+) create mode 100644 packages/ui/src/assets/eip/setheaders.png diff --git a/packages/ui/src/assets/eip/setheaders.png b/packages/ui/src/assets/eip/setheaders.png new file mode 100644 index 0000000000000000000000000000000000000000..04dc7bc2ebca11ec4313809b4b584b246a127f2c GIT binary patch literal 14476 zcmeHuc|4Te`~Pjr(juWn7*r^YF`HS!WKV@;O-i%T*w>I{Do>FXrJ_WNN-2bplqrgY zCQDS3B*wlk!;G2lJzAc6KF{y>{XW0n^Lc*1KR&nDnfol)b)D;do$FlZocnek-(h9G zSV}<(0D#37TTFI>_d|jtu>kz7Fd)_dz^Y|bCkr8(W+&#(sD`)5M?C= zMMagh+8Qcq8`mf*YGT%J)PbW=D2N75AB)h_Mxqb`AwrUpl8Y8DTDf@fN`$JSD&j9+ z{3n2ngg_?|AvHi)Mo2_Pi2n?LfO?7v&0k-kfMsD3QLzQ$5|UC2L4v}i0!xVqi;9Se ziHd@)kzhL@DkHW`6>hjd)`lpq<}ZgheD<2e8l$|Y@;mEC)*?v(MNJ@?tRDS&M#fv zte)P!(XsJ~$*F1f%&Y*H0O$AXE3!Y}k^ylEi;9YfiVJWF35N)P%ZQ4p!WS$vv=Jxz z%c>y`OUN0Wy_WY>at(6lh&(BvUTXPTRL8ne0knB!|1)4m{*RFT0QNhs_rM|%A#m_S zWB>v%!;90rD*XR#(#mJsOGLKiIZ>;#z z73F(Aaq$^8>*o3vd=VoAo=BU<^&K!HoXKh)U)@@gLs=DAoK^v8$Z;%*<%LkaQ+~5s$^7WG*ZV?Sb4ji`vKA=w@ZORx-W^yO_K-JE> z_2zGG$D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6 z;5_Q+*|eZV5g4&x=ch80FBn<1bSM3vGIlEpyaxmxMQAl>N7pHgiB#UR~95Mr= zLWXDzO4Ea}sOwS7u_BM6?(^8U!uqQD)7`L#SE4d=cB>VN!5-w4tY4KnFxJHFS#6HDt~h~ z-h=Cud8%ZrN`D=Cao-lx>I$t4PuX%R(&>E(v+%dv@uXqJiLoKYlv>N6t4F&k=pN)hZ!y zgZB0*E0Wje!?j;7F2AuIAJZ(!l{>T20C`zq#fO!UY`u$@6eBmN+Zh}^P;zX%f5V~p z_6KV=Ieg4I?r{Fb4U@F(EhZOVTODQsr>U4N(COaTB?-zk+bs!a`INpFB*kf~zN*@S z%d`HTLc-K@3-*|NYBk7zkWlU&@2akLFi<9*kT(0y{{ZEPk`Pa8vQu3+qG%aQRSDvH z<9u0?+?|d5w(<5mwB6;_b>OVpJL^6A;oVtn>&GRRn)2Tq8Jc6=i27i3NCkFQUp=Tu z)u@-gF=X;#R%X7ex)vkd(4xg74xznd$V;g-b=Ib)K=fV2;~VE*kY>}Gm~(S_Nrz6y zAA7^^Tb(>tU)+$Rf9oj`H#z=9%x}e+S@6Rp0N6L8b|&`LluL0E^<{!hdvibR$-XUQ zUiT@C>Jxpm;l;;l*P0wvbY|$zIfCJEyU~0&43M{n3}o*w%fEbf z-)-La?3Loixdx6V!H{GXncWf-H76eJ~ zV>K0!*hyT#a8E>B2>jwq5Hi8773mRg zYpJPqpOpqAM%GO&TzVH+%v(j~h9?^4uE`C} zw_2t@o9?&nMcd%@0SKNoy^w8OpA(T(+$O`#ZYZ0hiWQzp^=)2VcZBZrI??{Dd693c z^F4J_?`R;zCgRqH@rdx@A?0YAQq?A|Sdr_K?dLa)B3 literal 0 HcmV?d00001 diff --git a/packages/ui/src/utils/node-icon-resolver.ts b/packages/ui/src/utils/node-icon-resolver.ts index 9c0984cac..14b1cbb10 100644 --- a/packages/ui/src/utils/node-icon-resolver.ts +++ b/packages/ui/src/utils/node-icon-resolver.ts @@ -36,6 +36,7 @@ import sample from '../assets/eip/sample.png'; import script from '../assets/eip/script.png'; import set_body from '../assets/eip/setbody.png'; import set_header from '../assets/eip/setheader.png'; +import set_headers from '../assets/eip/setheaders.png'; import set_property from '../assets/eip/setproperty.png'; import sort from '../assets/eip/sort.png'; import split from '../assets/eip/split.png'; @@ -672,6 +673,8 @@ function getEIPIcon(elementName?: string): string | undefined { return set_body; case 'setHeader': return set_header; + case 'setHeaders': + return set_headers; case 'setProperty': return set_property; case 'sort': From 511ed52e4b0635e3164145fa359e42d7854f1207 Mon Sep 17 00:00:00 2001 From: Lars Heinemann Date: Mon, 20 Nov 2023 16:57:19 +0100 Subject: [PATCH 2/4] mark mandatory fields with a red asterisk (#282) Signed-off-by: Lars Heinemann --- .../flows/support/camel-component-schema.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts index 97116b6af..34bb74cfb 100644 --- a/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts +++ b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts @@ -224,6 +224,7 @@ export class CamelComponentSchemaService { title: 'Endpoint Properties', description: 'Endpoint properties description', properties: componentSchema.properties, + required: componentSchema.required }; } } From 5f9863685f9101e928d12414f9bb24532cf135de Mon Sep 17 00:00:00 2001 From: Lars Heinemann Date: Tue, 21 Nov 2023 13:57:18 +0100 Subject: [PATCH 3/4] fixed a linter error --- .../flows/support/camel-component-schema.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts index 34bb74cfb..21fe4fdc5 100644 --- a/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts +++ b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts @@ -224,7 +224,7 @@ export class CamelComponentSchemaService { title: 'Endpoint Properties', description: 'Endpoint properties description', properties: componentSchema.properties, - required: componentSchema.required + required: componentSchema.required, }; } } From 1dbe6ce99f28ca3e09d6fcd2c02459ccf543f73f Mon Sep 17 00:00:00 2001 From: "Ricardo M." Date: Tue, 21 Nov 2023 13:02:08 +0100 Subject: [PATCH 4/4] chore(services): Add missing tests for CamelComponentSchemaService --- .../PropertiesModal/PropertiesModal.models.ts | 2 +- .../ui/src/models/camel-properties-common.ts | 3 +- packages/ui/src/models/kamelets-catalog.ts | 2 +- ...amel-component-schema.service.test.ts.snap | 462 ++++++++++++++ .../camel-component-schema.service.test.ts | 338 +++++++++++ .../support/camel-component-schema.service.ts | 15 +- packages/ui/src/stubs/beer-source-kamelet.ts | 63 ++ packages/ui/src/stubs/log-component.ts | 564 ++++++++++++++++++ packages/ui/src/stubs/log-model.ts | 121 ++++ packages/ui/src/stubs/timer-component.ts | 319 ++++++++++ packages/ui/src/stubs/to-model.ts | 83 +++ 11 files changed, 1959 insertions(+), 13 deletions(-) create mode 100644 packages/ui/src/models/visualization/flows/support/__snapshots__/camel-component-schema.service.test.ts.snap create mode 100644 packages/ui/src/models/visualization/flows/support/camel-component-schema.service.test.ts create mode 100644 packages/ui/src/stubs/beer-source-kamelet.ts create mode 100644 packages/ui/src/stubs/log-component.ts create mode 100644 packages/ui/src/stubs/log-model.ts create mode 100644 packages/ui/src/stubs/timer-component.ts create mode 100644 packages/ui/src/stubs/to-model.ts diff --git a/packages/ui/src/components/PropertiesModal/PropertiesModal.models.ts b/packages/ui/src/components/PropertiesModal/PropertiesModal.models.ts index 0dae9b267..0f909377b 100644 --- a/packages/ui/src/components/PropertiesModal/PropertiesModal.models.ts +++ b/packages/ui/src/components/PropertiesModal/PropertiesModal.models.ts @@ -32,7 +32,7 @@ export interface IPropertiesRow { property?: string; name: string; description: string; - default?: string; + default?: string | boolean | number; type: string; example?: string; rowAdditionalInfo: IPropertiesRowAdditionalInfo; diff --git a/packages/ui/src/models/camel-properties-common.ts b/packages/ui/src/models/camel-properties-common.ts index 96fc46a42..0b63b09bd 100644 --- a/packages/ui/src/models/camel-properties-common.ts +++ b/packages/ui/src/models/camel-properties-common.ts @@ -8,8 +8,9 @@ export interface CamelPropertyCommon { javaType: string; enum?: string[]; autowired: boolean; - defaultValue?: string; + defaultValue?: string | boolean | number; deprecated: boolean; + deprecationNote?: string; secret: boolean; description: string; } diff --git a/packages/ui/src/models/kamelets-catalog.ts b/packages/ui/src/models/kamelets-catalog.ts index 5ed834a64..09e2ca38f 100644 --- a/packages/ui/src/models/kamelets-catalog.ts +++ b/packages/ui/src/models/kamelets-catalog.ts @@ -50,6 +50,6 @@ export interface IKameletSpecProperty { title: string; description: string; type: string; - default?: string; + default?: string | boolean | number; example?: string; } diff --git a/packages/ui/src/models/visualization/flows/support/__snapshots__/camel-component-schema.service.test.ts.snap b/packages/ui/src/models/visualization/flows/support/__snapshots__/camel-component-schema.service.test.ts.snap new file mode 100644 index 000000000..e023efed9 --- /dev/null +++ b/packages/ui/src/models/visualization/flows/support/__snapshots__/camel-component-schema.service.test.ts.snap @@ -0,0 +1,462 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CamelComponentSchemaService getSchemaFromCamelCommonProperties should return a schema with the properties 1`] = ` +{ + "properties": { + "description": { + "deprecated": false, + "description": "Sets the description of this node", + "title": "Description", + "type": "string", + }, + "disabled": { + "deprecated": false, + "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", + "title": "Disabled", + "type": "boolean", + }, + "id": { + "deprecated": false, + "description": "Sets the id of this node", + "title": "Id", + "type": "string", + }, + "logName": { + "deprecated": false, + "description": "Sets the name of the logger", + "title": "Log Name", + "type": "string", + }, + "logger": { + "deprecated": false, + "description": "To refer to a custom logger instance to lookup from the registry.", + "title": "Logger", + "type": "object", + }, + "loggingLevel": { + "deprecated": false, + "description": "Sets the logging level. The default value is INFO", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "OFF", + ], + "title": "Logging Level", + "type": undefined, + }, + "marker": { + "deprecated": false, + "description": "To use slf4j marker", + "title": "Marker", + "type": "string", + }, + "message": { + "deprecated": false, + "description": "Sets the log message (uses simple language)", + "title": "Message", + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", +} +`; + +exports[`CamelComponentSchemaService getVisualComponentSchema should build the appropriate schema for processors combined that holds a component 1`] = ` +{ + "definition": { + "id": "to-3044", + "parameters": { + "groupActiveOnly": true, + "level": "ERROR", + "logMask": true, + }, + "uri": "log", + }, + "schema": { + "properties": { + "description": { + "deprecated": false, + "description": "Sets the description of this node", + "title": "Description", + "type": "string", + }, + "disabled": { + "deprecated": false, + "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", + "title": "Disabled", + "type": "boolean", + }, + "id": { + "deprecated": false, + "description": "Sets the id of this node", + "title": "Id", + "type": "string", + }, + "parameters": { + "description": "Endpoint properties description", + "properties": { + "exchangeFormatter": { + "deprecated": false, + "description": "To use a custom exchange formatter", + "title": "Exchange Formatter", + "type": "object", + }, + "groupActiveOnly": { + "deprecated": false, + "description": "If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.", + "title": "Group Active Only", + "type": "boolean", + }, + "groupDelay": { + "deprecated": false, + "description": "Set the initial delay for stats (in millis)", + "title": "Group Delay", + "type": "integer", + }, + "groupInterval": { + "deprecated": false, + "description": "If specified will group message stats by this time interval (in millis)", + "title": "Group Interval", + "type": "integer", + }, + "groupSize": { + "deprecated": false, + "description": "An integer that specifies a group size for throughput logging.", + "title": "Group Size", + "type": "integer", + }, + "lazyStartProducer": { + "deprecated": false, + "description": "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.", + "title": "Lazy Start Producer", + "type": "boolean", + }, + "level": { + "deprecated": false, + "description": "Logging level to use. The default value is INFO.", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "OFF", + ], + "title": "Level", + "type": undefined, + }, + "logMask": { + "deprecated": false, + "description": "If true, mask sensitive information like password or passphrase in the log.", + "title": "Log Mask", + "type": "boolean", + }, + "loggerName": { + "deprecated": false, + "description": "Name of the logging category to use", + "title": "Logger Name", + "type": "string", + }, + "marker": { + "deprecated": false, + "description": "An optional Marker name to use.", + "title": "Marker", + "type": "string", + }, + "maxChars": { + "deprecated": false, + "description": "Limits the number of characters logged per line.", + "title": "Max Chars", + "type": "integer", + }, + "multiline": { + "deprecated": false, + "description": "If enabled then each information is outputted on a newline.", + "title": "Multiline", + "type": "boolean", + }, + "plain": { + "deprecated": false, + "description": "If enabled only the body will be printed out", + "title": "Plain", + "type": "boolean", + }, + "showAll": { + "deprecated": false, + "description": "Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used)", + "title": "Show All", + "type": "boolean", + }, + "showAllProperties": { + "deprecated": false, + "description": "Show all of the exchange properties (both internal and custom).", + "title": "Show All Properties", + "type": "boolean", + }, + "showBody": { + "deprecated": false, + "description": "Show the message body.", + "title": "Show Body", + "type": "boolean", + }, + "showBodyType": { + "deprecated": false, + "description": "Show the body Java type.", + "title": "Show Body Type", + "type": "boolean", + }, + "showCachedStreams": { + "deprecated": false, + "description": "Whether Camel should show cached stream bodies or not (org.apache.camel.StreamCache).", + "title": "Show Cached Streams", + "type": "boolean", + }, + "showCaughtException": { + "deprecated": false, + "description": "If the exchange has a caught exception, show the exception message (no stack trace). A caught exception is stored as a property on the exchange (using the key org.apache.camel.Exchange#EXCEPTION_CAUGHT) and for instance a doCatch can catch exceptions.", + "title": "Show Caught Exception", + "type": "boolean", + }, + "showException": { + "deprecated": false, + "description": "If the exchange has an exception, show the exception message (no stacktrace)", + "title": "Show Exception", + "type": "boolean", + }, + "showExchangeId": { + "deprecated": false, + "description": "Show the unique exchange ID.", + "title": "Show Exchange Id", + "type": "boolean", + }, + "showExchangePattern": { + "deprecated": false, + "description": "Shows the Message Exchange Pattern (or MEP for short).", + "title": "Show Exchange Pattern", + "type": "boolean", + }, + "showFiles": { + "deprecated": false, + "description": "If enabled Camel will output files", + "title": "Show Files", + "type": "boolean", + }, + "showFuture": { + "deprecated": false, + "description": "If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged.", + "title": "Show Future", + "type": "boolean", + }, + "showHeaders": { + "deprecated": false, + "description": "Show the message headers.", + "title": "Show Headers", + "type": "boolean", + }, + "showProperties": { + "deprecated": false, + "description": "Show the exchange properties (only custom). Use showAllProperties to show both internal and custom properties.", + "title": "Show Properties", + "type": "boolean", + }, + "showStackTrace": { + "deprecated": false, + "description": "Show the stack trace, if an exchange has an exception. Only effective if one of showAll, showException or showCaughtException are enabled.", + "title": "Show Stack Trace", + "type": "boolean", + }, + "showStreams": { + "deprecated": false, + "description": "Whether Camel should show stream bodies or not (eg such as java.io.InputStream). Beware if you enable this option then you may not be able later to access the message body as the stream have already been read by this logger. To remedy this you will have to use Stream Caching.", + "title": "Show Streams", + "type": "boolean", + }, + "skipBodyLineSeparator": { + "deprecated": false, + "description": "Whether to skip line separators when logging the message body. This allows to log the message body in one line, setting this option to false will preserve any line separators from the body, which then will log the body as is.", + "title": "Skip Body Line Separator", + "type": "boolean", + }, + "sourceLocationLoggerName": { + "deprecated": false, + "description": "If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead of the given name. However, if the source location is disabled or not possible to resolve then the existing logger name will be used.", + "title": "Source Location Logger Name", + "type": "boolean", + }, + "style": { + "deprecated": false, + "description": "Sets the outputs style to use.", + "enum": [ + "Default", + "Tab", + "Fixed", + ], + "title": "Style", + "type": undefined, + }, + }, + "required": [ + "loggerName", + ], + "title": "Endpoint Properties", + "type": "object", + }, + "pattern": { + "deprecated": false, + "description": "Sets the optional ExchangePattern used to invoke this endpoint", + "enum": [ + "InOnly", + "InOut", + ], + "title": "Pattern", + "type": undefined, + }, + "uri": { + "deprecated": false, + "description": "Sets the uri of the endpoint to send to.", + "title": "Uri", + "type": "string", + }, + }, + "required": [ + "uri", + ], + "type": "object", + }, + "title": "to", +} +`; + +exports[`CamelComponentSchemaService getVisualComponentSchema should build the appropriate schema for standalone processors 1`] = ` +{ + "definition": { + "message": "Hello World", + }, + "schema": { + "properties": { + "description": { + "deprecated": false, + "description": "Sets the description of this node", + "title": "Description", + "type": "string", + }, + "disabled": { + "deprecated": false, + "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", + "title": "Disabled", + "type": "boolean", + }, + "id": { + "deprecated": false, + "description": "Sets the id of this node", + "title": "Id", + "type": "string", + }, + "logName": { + "deprecated": false, + "description": "Sets the name of the logger", + "title": "Log Name", + "type": "string", + }, + "logger": { + "deprecated": false, + "description": "To refer to a custom logger instance to lookup from the registry.", + "title": "Logger", + "type": "object", + }, + "loggingLevel": { + "deprecated": false, + "description": "Sets the logging level. The default value is INFO", + "enum": [ + "TRACE", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "OFF", + ], + "title": "Logging Level", + "type": undefined, + }, + "marker": { + "deprecated": false, + "description": "To use slf4j marker", + "title": "Marker", + "type": "string", + }, + "message": { + "deprecated": false, + "description": "Sets the log message (uses simple language)", + "title": "Message", + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + "title": "log", +} +`; + +exports[`CamelComponentSchemaService getVisualComponentSchema should not build a schema for an unknown component 1`] = ` +{ + "definition": { + "id": "to-3044", + "parameters": { + "level": "ERROR", + }, + "uri": "non-existing-component", + }, + "schema": { + "properties": { + "description": { + "deprecated": false, + "description": "Sets the description of this node", + "title": "Description", + "type": "string", + }, + "disabled": { + "deprecated": false, + "description": "Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.", + "title": "Disabled", + "type": "boolean", + }, + "id": { + "deprecated": false, + "description": "Sets the id of this node", + "title": "Id", + "type": "string", + }, + "pattern": { + "deprecated": false, + "description": "Sets the optional ExchangePattern used to invoke this endpoint", + "enum": [ + "InOnly", + "InOut", + ], + "title": "Pattern", + "type": undefined, + }, + "uri": { + "deprecated": false, + "description": "Sets the uri of the endpoint to send to.", + "title": "Uri", + "type": "string", + }, + }, + "required": [ + "uri", + ], + "type": "object", + }, + "title": "to", +} +`; diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.test.ts b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.test.ts new file mode 100644 index 000000000..bee54b601 --- /dev/null +++ b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.test.ts @@ -0,0 +1,338 @@ +import { ProcessorDefinition } from '@kaoto-next/camel-catalog/types'; +import { CatalogKind } from '../../..'; +import { beerSourceKamelet } from '../../../../stubs/beer-source-kamelet'; +import { logComponent } from '../../../../stubs/log-component'; +import { logModel } from '../../../../stubs/log-model'; +import { timerComponent } from '../../../../stubs/timer-component'; +import { toModel } from '../../../../stubs/to-model'; +import { ICamelProcessorProperty } from '../../../camel-processors-catalog'; +import { CamelCatalogService } from '../camel-catalog.service'; +import { CamelComponentSchemaService } from './camel-component-schema.service'; + +describe('CamelComponentSchemaService', () => { + beforeEach(() => { + CamelCatalogService.setCatalogKey(CatalogKind.Component, { + log: logComponent, + timer: timerComponent, + }); + CamelCatalogService.setCatalogKey(CatalogKind.Processor, { + log: logModel, + to: toModel, + }); + CamelCatalogService.setCatalogKey(CatalogKind.Kamelet, { + 'beer-source': beerSourceKamelet, + }); + }); + + afterEach(() => { + jest.clearAllMocks(); + CamelCatalogService.clearCatalogs(); + }); + + describe('getVisualComponentSchema', () => { + const path = 'from'; + const definition = { uri: 'timer:foo?delay=1000&period=1000' }; + + it('should leverage the getCamelComponentLookup method', () => { + const getCamelComponentLookupSpy = jest.spyOn(CamelComponentSchemaService, 'getCamelComponentLookup'); + CamelComponentSchemaService.getVisualComponentSchema(path, definition); + + expect(getCamelComponentLookupSpy).toHaveBeenCalledWith(path, definition); + }); + + it('should return an empty schema when the processor it is not found', () => { + jest.spyOn(CamelComponentSchemaService, 'getCamelComponentLookup'); + const result = CamelComponentSchemaService.getVisualComponentSchema(path, definition); + + expect(result).toEqual({ + title: 'from', + schema: {}, + definition, + }); + }); + + it('should build the appropriate schema for standalone processors', () => { + const camelCatalogServiceSpy = jest.spyOn(CamelCatalogService, 'getComponent'); + const logPath = 'from.steps.0.log'; + const logDefinition = { message: 'Hello World' }; + + const result = CamelComponentSchemaService.getVisualComponentSchema(logPath, logDefinition); + + expect(camelCatalogServiceSpy).toHaveBeenCalledWith(CatalogKind.Processor, 'log'); + expect(result).toMatchSnapshot(); + }); + + it('should build the appropriate schema for processors combined that holds a component', () => { + const camelCatalogServiceSpy = jest.spyOn(CamelCatalogService, 'getComponent'); + const toLogPath = 'from.steps.0.to'; + const toLogDefinition = { + id: 'to-3044', + uri: 'log', + parameters: { + groupActiveOnly: true, + logMask: true, + level: 'ERROR', + }, + }; + + const result = CamelComponentSchemaService.getVisualComponentSchema(toLogPath, toLogDefinition); + + expect(camelCatalogServiceSpy).toHaveBeenCalledWith(CatalogKind.Processor, 'to'); + expect(camelCatalogServiceSpy).toHaveBeenCalledWith(CatalogKind.Component, 'log'); + expect(result).toMatchSnapshot(); + }); + + it('should not build a schema for an unknown component', () => { + const camelCatalogServiceSpy = jest.spyOn(CamelCatalogService, 'getComponent'); + const toNonExistingPath = 'from.steps.0.to'; + const toNonExistingDefinition = { + id: 'to-3044', + uri: 'non-existing-component', + parameters: { + level: 'ERROR', + }, + }; + + const result = CamelComponentSchemaService.getVisualComponentSchema(toNonExistingPath, toNonExistingDefinition); + + expect(camelCatalogServiceSpy).toHaveBeenCalledWith(CatalogKind.Processor, 'to'); + expect(camelCatalogServiceSpy).toHaveBeenCalledWith(CatalogKind.Component, 'non-existing-component'); + expect(result).toMatchSnapshot(); + }); + }); + + describe('getCamelComponentLookup', () => { + it.each([ + ['from', { uri: 'timer:foo?delay=1000&period=1000' }, { processorName: 'from', componentName: 'timer' }], + ['from.steps.0.to', { uri: 'log' }, { processorName: 'to', componentName: 'log' }], + ['from.steps.1.toD', { uri: 'log' }, { processorName: 'toD', componentName: 'log' }], + ['from.steps.0.to', 'log', { processorName: 'to', componentName: 'log' }], + ['from.steps.1.toD', 'log', { processorName: 'toD', componentName: 'log' }], + ['from.steps.2.log', { message: 'Hello World' }, { processorName: 'log' }], + ['from.steps.3.choice', {}, { processorName: 'choice' }], + ['from.steps.3.choice.when.0', {}, { processorName: 'when' }], + ['from.steps.3.choice.otherwise', {}, { processorName: 'otherwise' }], + ])('should return the processor and component name for %s', (path, definition, result) => { + const camelElementLookup = CamelComponentSchemaService.getCamelComponentLookup(path, definition); + + expect(camelElementLookup).toEqual(result); + }); + }); + + describe('getLabel', () => { + it('should return the component name if provided', () => { + const label = CamelComponentSchemaService.getLabel( + { processorName: 'from' as keyof ProcessorDefinition, componentName: 'timer' }, + {}, + ); + + expect(label).toEqual('timer'); + }); + + it.each([ + [ + { processorName: 'from' as keyof ProcessorDefinition }, + { uri: 'timer:foo?delay=1000&period=1000' }, + 'timer:foo?delay=1000&period=1000', + ], + [{ processorName: 'from' as keyof ProcessorDefinition }, {}, ''], + [{ processorName: 'to' as keyof ProcessorDefinition }, 'timer:foo', 'timer:foo'], + [{ processorName: 'toD' as keyof ProcessorDefinition }, 'log', 'log'], + [{ processorName: 'to' as keyof ProcessorDefinition }, { uri: 'timer:foo' }, 'timer:foo'], + [{ processorName: 'toD' as keyof ProcessorDefinition }, { uri: 'log' }, 'log'], + [{ processorName: 'to' as keyof ProcessorDefinition }, {}, 'to'], + [{ processorName: 'toD' as keyof ProcessorDefinition }, {}, 'toD'], + [{ processorName: 'choice' as keyof ProcessorDefinition }, {}, 'choice'], + [{ processorName: 'otherwise' as keyof ProcessorDefinition }, {}, 'otherwise'], + ])( + 'should return the processor name if the component name is not provided: %s', + (componentLookup, definition, result) => { + const label = CamelComponentSchemaService.getLabel(componentLookup, definition); + + expect(label).toEqual(result); + }, + ); + }); + + describe('canHavePreviousStep', () => { + it.each([ + ['from', false], + ['when', false], + ['otherwise', false], + ['doCatch', false], + ['doFinally', false], + ['aggregate', true], + ['onFallback', true], + ['saga', true], + ])('should return whether the %s processor could have a previous step', (processorName, result) => { + const canHavePreviousStep = CamelComponentSchemaService.canHavePreviousStep( + processorName as keyof ProcessorDefinition, + ); + + expect(canHavePreviousStep).toEqual(result); + }); + }); + + describe('getProcessorStepsProperties', () => { + it.each([ + ['from', [{ name: 'steps', type: 'branch' }]], + ['when', [{ name: 'steps', type: 'branch' }]], + ['otherwise', [{ name: 'steps', type: 'branch' }]], + ['doCatch', [{ name: 'steps', type: 'branch' }]], + ['doFinally', [{ name: 'steps', type: 'branch' }]], + ['aggregate', [{ name: 'steps', type: 'branch' }]], + ['onFallback', [{ name: 'steps', type: 'branch' }]], + ['saga', [{ name: 'steps', type: 'branch' }]], + [ + 'choice', + [ + { name: 'when', type: 'clause-list' }, + { name: 'otherwise', type: 'single-clause' }, + ], + ], + [ + 'doTry', + [ + { name: 'steps', type: 'branch' }, + { name: 'doCatch', type: 'clause-list' }, + { name: 'doFinally', type: 'single-clause' }, + ], + ], + ['to', []], + ['toD', []], + ['log', []], + ])(`should return the steps properties for '%s'`, (processorName, result) => { + const stepsProperties = CamelComponentSchemaService.getProcessorStepsProperties( + processorName as keyof ProcessorDefinition, + ); + + expect(stepsProperties).toEqual(result); + }); + }); + + describe('getIconName', () => { + it('should return the component name if provided', () => { + const iconName = CamelComponentSchemaService.getIconName({ + processorName: 'from' as keyof ProcessorDefinition, + componentName: 'timer', + }); + + expect(iconName).toEqual('timer'); + }); + + it('should return the kamelet name if provided', () => { + const iconName = CamelComponentSchemaService.getIconName({ + processorName: 'from' as keyof ProcessorDefinition, + componentName: 'kamelet:beer-source', + }); + + expect(iconName).toEqual('kamelet:beer-source'); + }); + + it('should return the processor name if the component name is not provided', () => { + const iconName = CamelComponentSchemaService.getIconName({ + processorName: 'log', + }); + + expect(iconName).toEqual('log'); + }); + + it('should return an empty string if not found', () => { + const iconName = CamelComponentSchemaService.getIconName({ + processorName: 'from' as keyof ProcessorDefinition, + }); + + expect(iconName).toEqual(''); + }); + }); + + describe('getJSONType', () => { + it('should return the JSON type for enums', () => { + const enumProperty: ICamelProcessorProperty = { + index: 1, + kind: 'attribute', + displayName: 'Library', + required: false, + type: 'enum', + javaType: 'org.apache.camel.model.dataformat.AvroLibrary', + enum: ['ApacheAvro', 'Jackson'], + deprecated: false, + autowired: false, + secret: false, + defaultValue: 'ApacheAvro', + description: 'Which Avro library to use.', + }; + + const jsonType = CamelComponentSchemaService.getJSONType(enumProperty); + expect(jsonType).toEqual(undefined); + }); + + it('should return the JSON type for a duration field', () => { + const durationProperty: ICamelProcessorProperty = { + index: 1, + kind: 'attribute', + displayName: 'Batch Timeout', + required: false, + type: 'duration', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + defaultValue: '1000', + description: 'Sets the timeout for collecting elements to be re-ordered. The default timeout is 1000 msec.', + }; + const jsonType = CamelComponentSchemaService.getJSONType(durationProperty); + expect(jsonType).toEqual('string'); + }); + + it('should return the JSON type for a duration field', () => { + const objectProperty: ICamelProcessorProperty = { + index: 0, + kind: 'expression', + displayName: 'Correlation Expression', + required: true, + type: 'object', + javaType: 'org.apache.camel.model.ExpressionSubElementDefinition', + oneOf: ['python', 'xpath'], + deprecated: false, + autowired: false, + secret: false, + description: 'The expression used to calculate the correlation key to use for aggregation.', + }; + const jsonType = CamelComponentSchemaService.getJSONType(objectProperty); + expect(jsonType).toEqual('object'); + }); + }); + + describe('getComponentNameFromUri', () => { + it('should return undefined if the uri is empty', () => { + const componentName = CamelComponentSchemaService.getComponentNameFromUri(''); + expect(componentName).toBeUndefined(); + }); + + it('should return the kamelet component name', () => { + const uri = 'kamelet:beer-source'; + const componentName = CamelComponentSchemaService.getComponentNameFromUri(uri); + expect(componentName).toEqual('kamelet:beer-source'); + }); + + it('should return the component name from the uri', () => { + const uri = 'timer:foo?delay=1000&period=1000'; + const componentName = CamelComponentSchemaService.getComponentNameFromUri(uri); + expect(componentName).toEqual('timer'); + }); + }); + + describe('getSchemaFromCamelCommonProperties', () => { + it('should return an empty schema if the properties are empty', () => { + const schema = CamelComponentSchemaService.getSchemaFromCamelCommonProperties({}); + expect(schema).toEqual({ properties: {}, required: [], type: 'object' }); + }); + + it('should return a schema with the properties', () => { + const schema = CamelComponentSchemaService.getSchemaFromCamelCommonProperties(logModel.properties); + + expect(schema).toMatchSnapshot(); + }); + }); +}); diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts index 21fe4fdc5..bfc0bf648 100644 --- a/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts +++ b/packages/ui/src/models/visualization/flows/support/camel-component-schema.service.ts @@ -31,7 +31,7 @@ export class CamelComponentSchemaService { /** * If the last path segment is NaN, it means this is a Camel Processor - * for instance, `from`, `when`, `otherwise` or `to` properties in a Route + * for instance, `from`, `otherwise` or `to` properties in a Route * and we can just return the path as the name of the component */ if (Number.isNaN(pathAsIndex)) { @@ -44,14 +44,7 @@ export class CamelComponentSchemaService { * for instance, a `when` property in a `Choice` processor */ const previousPathSegment = splitPath[splitPath.length - 2]; - if (typeof previousPathSegment === 'string') { - return this.getCamelElement(previousPathSegment as keyof ProcessorDefinition, definition); - } - - /** - * If we reach this point, it means we couldn't determine the name of the component - */ - return { processorName: '' as keyof ProcessorDefinition }; + return this.getCamelElement(previousPathSegment as keyof ProcessorDefinition, definition); } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -66,7 +59,7 @@ export class CamelComponentSchemaService { case 'to': case 'toD': - return typeof definition === 'string' ? definition : definition.uri ?? 'To'; + return typeof definition === 'string' ? definition : definition.uri ?? camelElementLookup.processorName; default: return camelElementLookup.processorName; @@ -119,6 +112,7 @@ export class CamelComponentSchemaService { return camelElementLookup.componentName; } } + if ( isDefined(camelElementLookup.processorName) && !isDefined(camelElementLookup.componentName) && @@ -126,6 +120,7 @@ export class CamelComponentSchemaService { ) { return camelElementLookup.processorName; } + return ''; } diff --git a/packages/ui/src/stubs/beer-source-kamelet.ts b/packages/ui/src/stubs/beer-source-kamelet.ts new file mode 100644 index 000000000..3ae870a3c --- /dev/null +++ b/packages/ui/src/stubs/beer-source-kamelet.ts @@ -0,0 +1,63 @@ +import { CatalogKind, IKameletDefinition } from '../models'; + +export const beerSourceKamelet: IKameletDefinition = { + apiVersion: 'camel.apache.org/v1', + kind: CatalogKind.Kamelet, + metadata: { + name: 'beer-source', + annotations: { + 'camel.apache.org/kamelet.support.level': 'Stable', + 'camel.apache.org/catalog.version': '4.1.0', + 'camel.apache.org/kamelet.icon': + 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iOTJwdCIgd2lkdGg9IjkycHQiIHZlcnNpb249IjEuMCIgeG1sbnM6Y2M9Imh0dHA6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL25zIyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyI+Cgk8ZGVmcz4KCQk8bGluZWFyR3JhZGllbnQgaWQ9ImEiPgoJCQk8c3RvcCBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9Ii41IiBvZmZzZXQ9IjAiLz4KCQkJPHN0b3Agc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIuMSIgb2Zmc2V0PSIxIi8+CgkJPC9saW5lYXJHcmFkaWVudD4KCQk8bGluZWFyR3Jh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Q9Im00OC4zNzIgMjIuMzc0Yy0wLjEwNC00LjcyMSAxNC4wMDktOC41OTEgMTEuMjUtMC4zMTMgMS4yNjktMC42MzQgNi44NzUtMS4yOTkgNS44NDQgMi4zMTQgNC4xMjMtMC40NjYgMTAuMzkgMS4xMDQgNi42NjIgNi42ODggMi4zOTYgMS44MDYgMS4zMzEgNi42OTYtMC4zMTkgNS4wNjEiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2Utd2lkdGg9IjFwdCIgZmlsbD0ibm9uZSIvPgo8L3N2Zz4K', + 'camel.apache.org/provider': 'Apache Software Foundation', + 'camel.apache.org/kamelet.group': 'Beers', + 'camel.apache.org/kamelet.namespace': 'Dataset', + }, + labels: { + 'camel.apache.org/kamelet.type': 'source', + }, + }, + spec: { + definition: { + title: 'Beer Source', + description: 'Produces periodic events about beers!', + type: 'object', + properties: { + period: { + title: 'Period', + description: 'The time interval between two events', + type: 'integer', + default: 5000, + }, + }, + }, + types: { + out: { + mediaType: 'application/json', + }, + }, + dependencies: ['camel:timer', 'camel:http', 'camel:kamelet'], + template: { + from: { + uri: 'timer:beer', + parameters: { + period: '{{period}}', + }, + steps: [ + { + to: 'https://random-data-api.com/api/beer/random_beer', + }, + { + removeHeaders: null, + pattern: '*', + }, + { + to: 'kamelet:sink', + }, + ], + }, + beans: undefined, + }, + }, +} as IKameletDefinition; diff --git a/packages/ui/src/stubs/log-component.ts b/packages/ui/src/stubs/log-component.ts new file mode 100644 index 000000000..fcb66b82e --- /dev/null +++ b/packages/ui/src/stubs/log-component.ts @@ -0,0 +1,564 @@ +import { CatalogKind, ICamelComponentDefinition } from '../models'; + +export const logComponent: ICamelComponentDefinition = { + component: { + kind: CatalogKind.Component, + name: 'log', + title: 'Log', + description: 'Log messages to the underlying logging mechanism.', + deprecated: false, + firstVersion: '1.1.0', + label: 'core,monitoring', + javaType: 'org.apache.camel.component.log.LogComponent', + supportLevel: 'Stable', + groupId: 'org.apache.camel', + artifactId: 'camel-log', + version: '4.2.0', + scheme: 'log', + extendsScheme: '', + syntax: 'log:loggerName', + async: false, + api: false, + consumerOnly: false, + producerOnly: true, + lenientProperties: false, + }, + componentProperties: { + lazyStartProducer: { + index: 0, + kind: 'property', + displayName: 'Lazy Start Producer', + group: 'producer', + label: 'producer', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.", + }, + sourceLocationLoggerName: { + index: 1, + kind: 'property', + displayName: 'Source Location Logger Name', + group: 'producer', + label: '', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead of the given name. However, if the source location is disabled or not possible to resolve then the existing logger name will be used.', + }, + autowiredEnabled: { + index: 2, + kind: 'property', + displayName: 'Autowired Enabled', + group: 'advanced', + label: 'advanced', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: true, + description: + 'Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.', + }, + exchangeFormatter: { + index: 3, + kind: 'property', + displayName: 'Exchange Formatter', + group: 'advanced', + label: 'advanced', + required: false, + type: 'object', + javaType: 'org.apache.camel.spi.ExchangeFormatter', + deprecated: false, + autowired: true, + secret: false, + description: + 'Sets a custom ExchangeFormatter to convert the Exchange to a String suitable for logging. If not specified, we default to DefaultExchangeFormatter.', + }, + }, + properties: { + loggerName: { + index: 0, + kind: 'path', + displayName: 'Logger Name', + group: 'producer', + label: '', + required: true, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + deprecationNote: '', + autowired: false, + secret: false, + description: 'Name of the logging category to use', + }, + groupActiveOnly: { + index: 1, + kind: 'parameter', + displayName: 'Group Active Only', + group: 'producer', + label: '', + required: false, + type: 'boolean', + javaType: 'java.lang.Boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: 'true', + description: + 'If true, will hide stats when no new messages have been received for a time interval, if false, show stats regardless of message traffic.', + }, + groupDelay: { + index: 2, + kind: 'parameter', + displayName: 'Group Delay', + group: 'producer', + label: '', + required: false, + type: 'integer', + javaType: 'java.lang.Long', + deprecated: false, + autowired: false, + secret: false, + description: 'Set the initial delay for stats (in millis)', + }, + groupInterval: { + index: 3, + kind: 'parameter', + displayName: 'Group Interval', + group: 'producer', + label: '', + required: false, + type: 'integer', + javaType: 'java.lang.Long', + deprecated: false, + autowired: false, + secret: false, + description: 'If specified will group message stats by this time interval (in millis)', + }, + groupSize: { + index: 4, + kind: 'parameter', + displayName: 'Group Size', + group: 'producer', + label: '', + required: false, + type: 'integer', + javaType: 'java.lang.Integer', + deprecated: false, + autowired: false, + secret: false, + description: 'An integer that specifies a group size for throughput logging.', + }, + level: { + index: 5, + kind: 'parameter', + displayName: 'Level', + group: 'producer', + label: '', + required: false, + type: 'string', + javaType: 'java.lang.String', + enum: ['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'OFF'], + deprecated: false, + autowired: false, + secret: false, + defaultValue: 'INFO', + description: 'Logging level to use. The default value is INFO.', + }, + logMask: { + index: 6, + kind: 'parameter', + displayName: 'Log Mask', + group: 'producer', + label: '', + required: false, + type: 'boolean', + javaType: 'java.lang.Boolean', + deprecated: false, + autowired: false, + secret: false, + description: 'If true, mask sensitive information like password or passphrase in the log.', + }, + marker: { + index: 7, + kind: 'parameter', + displayName: 'Marker', + group: 'producer', + label: '', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'An optional Marker name to use.', + }, + plain: { + index: 8, + kind: 'parameter', + displayName: 'Plain', + group: 'producer', + label: '', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'If enabled only the body will be printed out', + }, + sourceLocationLoggerName: { + index: 9, + kind: 'parameter', + displayName: 'Source Location Logger Name', + group: 'producer', + label: '', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'If enabled then the source location of where the log endpoint is used in Camel routes, would be used as logger name, instead of the given name. However, if the source location is disabled or not possible to resolve then the existing logger name will be used.', + }, + lazyStartProducer: { + index: 10, + kind: 'parameter', + displayName: 'Lazy Start Producer', + group: 'producer (advanced)', + label: 'producer,advanced', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + "Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing.", + }, + exchangeFormatter: { + index: 11, + kind: 'parameter', + displayName: 'Exchange Formatter', + group: 'advanced', + label: 'advanced', + required: false, + type: 'object', + javaType: 'org.apache.camel.spi.ExchangeFormatter', + deprecated: false, + autowired: false, + secret: false, + description: 'To use a custom exchange formatter', + }, + maxChars: { + index: 12, + kind: 'parameter', + displayName: 'Max Chars', + group: 'formatting', + label: 'formatting', + required: false, + type: 'integer', + javaType: 'int', + deprecated: false, + autowired: false, + secret: false, + defaultValue: 10000, + description: 'Limits the number of characters logged per line.', + }, + multiline: { + index: 13, + kind: 'parameter', + displayName: 'Multiline', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'If enabled then each information is outputted on a newline.', + }, + showAll: { + index: 14, + kind: 'parameter', + displayName: 'Show All', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Quick option for turning all options on. (multiline, maxChars has to be manually set if to be used)', + }, + showAllProperties: { + index: 15, + kind: 'parameter', + displayName: 'Show All Properties', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Show all of the exchange properties (both internal and custom).', + }, + showBody: { + index: 16, + kind: 'parameter', + displayName: 'Show Body', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: true, + description: 'Show the message body.', + }, + showBodyType: { + index: 17, + kind: 'parameter', + displayName: 'Show Body Type', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: true, + description: 'Show the body Java type.', + }, + showCachedStreams: { + index: 18, + kind: 'parameter', + displayName: 'Show Cached Streams', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: true, + description: 'Whether Camel should show cached stream bodies or not (org.apache.camel.StreamCache).', + }, + showCaughtException: { + index: 19, + kind: 'parameter', + displayName: 'Show Caught Exception', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'If the exchange has a caught exception, show the exception message (no stack trace). A caught exception is stored as a property on the exchange (using the key org.apache.camel.Exchange#EXCEPTION_CAUGHT) and for instance a doCatch can catch exceptions.', + }, + showException: { + index: 20, + kind: 'parameter', + displayName: 'Show Exception', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'If the exchange has an exception, show the exception message (no stacktrace)', + }, + showExchangeId: { + index: 21, + kind: 'parameter', + displayName: 'Show Exchange Id', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Show the unique exchange ID.', + }, + showExchangePattern: { + index: 22, + kind: 'parameter', + displayName: 'Show Exchange Pattern', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Shows the Message Exchange Pattern (or MEP for short).', + }, + showFiles: { + index: 23, + kind: 'parameter', + displayName: 'Show Files', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'If enabled Camel will output files', + }, + showFuture: { + index: 24, + kind: 'parameter', + displayName: 'Show Future', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'If enabled Camel will on Future objects wait for it to complete to obtain the payload to be logged.', + }, + showHeaders: { + index: 25, + kind: 'parameter', + displayName: 'Show Headers', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Show the message headers.', + }, + showProperties: { + index: 26, + kind: 'parameter', + displayName: 'Show Properties', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Show the exchange properties (only custom). Use showAllProperties to show both internal and custom properties.', + }, + showStackTrace: { + index: 27, + kind: 'parameter', + displayName: 'Show Stack Trace', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Show the stack trace, if an exchange has an exception. Only effective if one of showAll, showException or showCaughtException are enabled.', + }, + showStreams: { + index: 28, + kind: 'parameter', + displayName: 'Show Streams', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Whether Camel should show stream bodies or not (eg such as java.io.InputStream). Beware if you enable this option then you may not be able later to access the message body as the stream have already been read by this logger. To remedy this you will have to use Stream Caching.', + }, + skipBodyLineSeparator: { + index: 29, + kind: 'parameter', + displayName: 'Skip Body Line Separator', + group: 'formatting', + label: 'formatting', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: true, + description: + 'Whether to skip line separators when logging the message body. This allows to log the message body in one line, setting this option to false will preserve any line separators from the body, which then will log the body as is.', + }, + style: { + index: 30, + kind: 'parameter', + displayName: 'Style', + group: 'formatting', + label: 'formatting', + required: false, + type: 'object', + javaType: 'org.apache.camel.support.processor.DefaultExchangeFormatter.OutputStyle', + enum: ['Default', 'Tab', 'Fixed'], + deprecated: false, + autowired: false, + secret: false, + defaultValue: 'Default', + description: 'Sets the outputs style to use.', + }, + }, +}; diff --git a/packages/ui/src/stubs/log-model.ts b/packages/ui/src/stubs/log-model.ts new file mode 100644 index 000000000..886b5e811 --- /dev/null +++ b/packages/ui/src/stubs/log-model.ts @@ -0,0 +1,121 @@ +import { CatalogKind, ICamelProcessorDefinition } from '../models'; + +export const logModel: ICamelProcessorDefinition = { + model: { + kind: CatalogKind.Processor, + name: 'log', + title: 'Log', + description: 'Logs the defined message to the logger', + deprecated: false, + label: 'eip,routing', + javaType: 'org.apache.camel.model.LogDefinition', + abstract: false, + input: true, + output: false, + }, + properties: { + message: { + index: 0, + kind: 'attribute', + displayName: 'Message', + required: true, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the log message (uses simple language)', + }, + loggingLevel: { + index: 1, + kind: 'attribute', + displayName: 'Logging Level', + required: false, + type: 'enum', + javaType: 'org.apache.camel.LoggingLevel', + enum: ['TRACE', 'DEBUG', 'INFO', 'WARN', 'ERROR', 'OFF'], + deprecated: false, + autowired: false, + secret: false, + defaultValue: 'INFO', + description: 'Sets the logging level. The default value is INFO', + }, + logName: { + index: 2, + kind: 'attribute', + displayName: 'Log Name', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the name of the logger', + }, + marker: { + index: 3, + kind: 'attribute', + displayName: 'Marker', + label: 'advanced', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'To use slf4j marker', + }, + logger: { + index: 4, + kind: 'attribute', + displayName: 'Logger', + label: 'advanced', + required: false, + type: 'object', + javaType: 'org.slf4j.Logger', + deprecated: false, + autowired: false, + secret: false, + description: 'To refer to a custom logger instance to lookup from the registry.', + }, + disabled: { + index: 5, + kind: 'attribute', + displayName: 'Disabled', + label: 'advanced', + required: false, + type: 'boolean', + javaType: 'java.lang.Boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.', + }, + id: { + index: 6, + kind: 'attribute', + displayName: 'Id', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the id of this node', + }, + description: { + index: 7, + kind: 'element', + displayName: 'Description', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the description of this node', + }, + }, +}; diff --git a/packages/ui/src/stubs/timer-component.ts b/packages/ui/src/stubs/timer-component.ts new file mode 100644 index 000000000..2509192b8 --- /dev/null +++ b/packages/ui/src/stubs/timer-component.ts @@ -0,0 +1,319 @@ +import { CatalogKind, ICamelComponentDefinition } from '../models'; + +export const timerComponent: ICamelComponentDefinition = { + component: { + kind: CatalogKind.Component, + name: 'timer', + title: 'Timer', + description: 'Generate messages in specified intervals using java.util.Timer.', + deprecated: false, + firstVersion: '1.0.0', + label: 'core,scheduling', + javaType: 'org.apache.camel.component.timer.TimerComponent', + supportLevel: 'Stable', + groupId: 'org.apache.camel', + artifactId: 'camel-timer', + version: '4.2.0', + scheme: 'timer', + extendsScheme: '', + syntax: 'timer:timerName', + async: false, + api: false, + consumerOnly: true, + producerOnly: false, + lenientProperties: false, + }, + componentProperties: { + bridgeErrorHandler: { + index: 0, + kind: 'property', + displayName: 'Bridge Error Handler', + group: 'consumer', + label: 'consumer', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.', + }, + includeMetadata: { + index: 1, + kind: 'property', + displayName: 'Include Metadata', + group: 'consumer', + label: '', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Whether to include metadata in the exchange such as fired time, timer name, timer count etc.', + }, + autowiredEnabled: { + index: 2, + kind: 'property', + displayName: 'Autowired Enabled', + group: 'advanced', + label: 'advanced', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: true, + description: + 'Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which then gets configured on the component. This can be used for automatic configuring JDBC data sources, JMS connection factories, AWS Clients, etc.', + }, + }, + headers: { + CamelTimerFiredTime: { + index: 0, + kind: 'header', + displayName: '', + group: 'consumer', + label: '', + required: false, + javaType: 'Date', + deprecated: false, + deprecationNote: '', + autowired: false, + secret: false, + description: 'The fired time', + constantName: 'org.apache.camel.component.timer.TimerConstants#HEADER_FIRED_TIME', + }, + CamelMessageTimestamp: { + index: 1, + kind: 'header', + displayName: '', + group: 'consumer', + label: '', + required: false, + javaType: 'long', + deprecated: false, + deprecationNote: '', + autowired: false, + secret: false, + description: 'The timestamp of the message', + constantName: 'org.apache.camel.component.timer.TimerConstants#HEADER_MESSAGE_TIMESTAMP', + }, + }, + properties: { + timerName: { + index: 0, + kind: 'path', + displayName: 'Timer Name', + group: 'consumer', + label: '', + required: true, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + deprecationNote: '', + autowired: false, + secret: false, + description: 'The name of the timer', + }, + delay: { + index: 1, + kind: 'parameter', + displayName: 'Delay', + group: 'consumer', + label: '', + required: false, + type: 'duration', + javaType: 'long', + deprecated: false, + autowired: false, + secret: false, + defaultValue: '1000', + description: 'Delay before first event is triggered.', + }, + fixedRate: { + index: 2, + kind: 'parameter', + displayName: 'Fixed Rate', + group: 'consumer', + label: '', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Events take place at approximately regular intervals, separated by the specified period.', + }, + includeMetadata: { + index: 3, + kind: 'parameter', + displayName: 'Include Metadata', + group: 'consumer', + label: '', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Whether to include metadata in the exchange such as fired time, timer name, timer count etc.', + }, + period: { + index: 4, + kind: 'parameter', + displayName: 'Period', + group: 'consumer', + label: '', + required: false, + type: 'duration', + javaType: 'long', + deprecated: false, + autowired: false, + secret: false, + defaultValue: '1000', + description: 'If greater than 0, generate periodic events every period.', + }, + repeatCount: { + index: 5, + kind: 'parameter', + displayName: 'Repeat Count', + group: 'consumer', + label: '', + required: false, + type: 'integer', + javaType: 'long', + deprecated: false, + autowired: false, + secret: false, + description: + 'Specifies a maximum limit of number of fires. So if you set it to 1, the timer will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever.', + }, + bridgeErrorHandler: { + index: 6, + kind: 'parameter', + displayName: 'Bridge Error Handler', + group: 'consumer (advanced)', + label: 'consumer,advanced', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions (if possible) occurred while the Camel consumer is trying to pickup incoming messages, or the likes, will now be processed as a message and handled by the routing Error Handler. Important: This is only possible if the 3rd party component allows Camel to be alerted if an exception was thrown. Some components handle this internally only, and therefore bridgeErrorHandler is not possible. In other situations we may improve the Camel component to hook into the 3rd party component and make this possible for future releases. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions, that will be logged at WARN or ERROR level and ignored.', + }, + exceptionHandler: { + index: 7, + kind: 'parameter', + displayName: 'Exception Handler', + group: 'consumer (advanced)', + label: 'consumer,advanced', + required: false, + type: 'object', + javaType: 'org.apache.camel.spi.ExceptionHandler', + deprecated: false, + autowired: false, + secret: false, + description: + 'To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the consumer will deal with exceptions, that will be logged at WARN or ERROR level and ignored.', + }, + exchangePattern: { + index: 8, + kind: 'parameter', + displayName: 'Exchange Pattern', + group: 'consumer (advanced)', + label: 'consumer,advanced', + required: false, + type: 'object', + javaType: 'org.apache.camel.ExchangePattern', + enum: ['InOnly', 'InOut'], + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the exchange pattern when the consumer creates an exchange.', + }, + daemon: { + index: 9, + kind: 'parameter', + displayName: 'Daemon', + group: 'advanced', + label: 'advanced', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: true, + description: + 'Specifies whether or not the thread associated with the timer endpoint runs as a daemon. The default value is true.', + }, + pattern: { + index: 10, + kind: 'parameter', + displayName: 'Pattern', + group: 'advanced', + label: 'advanced', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Allows you to specify a custom Date pattern to use for setting the time option using URI syntax.', + }, + synchronous: { + index: 11, + kind: 'parameter', + displayName: 'Synchronous', + group: 'advanced', + label: 'advanced', + required: false, + type: 'boolean', + javaType: 'boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: 'Sets whether synchronous processing should be strictly used', + }, + time: { + index: 12, + kind: 'parameter', + displayName: 'Time', + group: 'advanced', + label: 'advanced', + required: false, + type: 'string', + javaType: 'java.util.Date', + deprecated: false, + autowired: false, + secret: false, + description: + "A java.util.Date the first event should be generated. If using the URI, the pattern expected is: yyyy-MM-dd HH:mm:ss or yyyy-MM-dd'T'HH:mm:ss.", + }, + timer: { + index: 13, + kind: 'parameter', + displayName: 'Timer', + group: 'advanced', + label: 'advanced', + required: false, + type: 'object', + javaType: 'java.util.Timer', + deprecated: false, + autowired: false, + secret: false, + description: 'To use a custom Timer', + }, + }, +}; diff --git a/packages/ui/src/stubs/to-model.ts b/packages/ui/src/stubs/to-model.ts new file mode 100644 index 000000000..f9af415a2 --- /dev/null +++ b/packages/ui/src/stubs/to-model.ts @@ -0,0 +1,83 @@ +import { CatalogKind, ICamelProcessorDefinition } from '../models'; + +export const toModel: ICamelProcessorDefinition = { + model: { + kind: CatalogKind.Processor, + name: 'to', + title: 'To', + description: 'Sends the message to a static endpoint', + deprecated: false, + label: 'eip,routing', + javaType: 'org.apache.camel.model.ToDefinition', + abstract: false, + input: true, + output: false, + }, + properties: { + uri: { + index: 0, + kind: 'attribute', + displayName: 'Uri', + required: true, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the uri of the endpoint to send to.', + }, + disabled: { + index: 1, + kind: 'attribute', + displayName: 'Disabled', + label: 'advanced', + required: false, + type: 'boolean', + javaType: 'java.lang.Boolean', + deprecated: false, + autowired: false, + secret: false, + defaultValue: false, + description: + 'Whether to disable this EIP from the route during build time. Once an EIP has been disabled then it cannot be enabled later at runtime.', + }, + pattern: { + index: 2, + kind: 'attribute', + displayName: 'Pattern', + label: 'advanced', + required: false, + type: 'enum', + javaType: 'org.apache.camel.ExchangePattern', + enum: ['InOnly', 'InOut'], + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the optional ExchangePattern used to invoke this endpoint', + }, + id: { + index: 3, + kind: 'attribute', + displayName: 'Id', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the id of this node', + }, + description: { + index: 4, + kind: 'element', + displayName: 'Description', + required: false, + type: 'string', + javaType: 'java.lang.String', + deprecated: false, + autowired: false, + secret: false, + description: 'Sets the description of this node', + }, + }, +};