1pub mod commands;
2mod security;
3pub mod template;
4
5use std::sync::Arc;
6
7macro_rules! register_bundle_empty {
16 ($ctx:expr, $Bundle:ty) => {{
17 let key = <$Bundle as camel_component_api::ComponentBundle>::config_key();
18 match <$Bundle as camel_component_api::ComponentBundle>::from_toml(
19 ::toml::Value::Table(::toml::map::Map::new()),
20 ) {
21 Ok(bundle) => {
22 <$Bundle as camel_component_api::ComponentBundle>::register_all(
23 bundle,
24 &mut *$ctx,
25 );
26 }
27 Err(err) => {
28 tracing::warn!(
29 bundle = %key,
30 error = %err,
31 "lint catalog: empty-config build failed; skipping bundle (surfaces as unverified-scheme)"
32 );
33 }
34 }
35 }};
36}
37
38macro_rules! register_datasource_bundle_empty {
42 ($ctx:expr, $Bundle:ty, $catalog:expr) => {{
43 let key = <$Bundle as camel_component_api::ComponentBundle>::config_key();
44 match <$Bundle as camel_component_api::ComponentBundle>::from_toml(
45 ::toml::Value::Table(::toml::map::Map::new()),
46 ) {
47 Ok(bundle) => {
48 let bundle = bundle.with_catalog(::std::sync::Arc::clone(&$catalog));
49 <$Bundle as camel_component_api::ComponentBundle>::register_all(
50 bundle,
51 &mut *$ctx,
52 );
53 }
54 Err(err) => {
55 tracing::warn!(
56 bundle = %key,
57 error = %err,
58 "lint catalog: empty-config build failed; skipping datasource bundle (surfaces as unverified-scheme)"
59 );
60 }
61 }
62 }};
63}
64
65pub fn register_builtin_components_for_lint(ctx: &mut camel_core::CamelContext) {
88 use camel_api::datasource::DatasourceCatalog;
89 use camel_core::datasource::RuntimeDatasourceCatalog;
90
91 ctx.register_component(camel_component_timer::TimerComponent::new());
93 ctx.register_component(camel_component_cron::CronComponent::new());
94 ctx.register_component(camel_component_log::LogComponent::new());
95 ctx.register_component(camel_component_direct::DirectComponent::new());
96 ctx.register_component(camel_component_seda::SedaComponent::new());
97 ctx.register_component(camel_component_mock::MockComponent::new());
98 ctx.register_component(camel_component_controlbus::ControlBusComponent::new());
99
100 ctx.register_component(camel_component_validator::ValidatorComponent::new());
103 ctx.register_component(camel_xslt::XsltComponent::default());
106 ctx.register_component(camel_xj::XjComponent::default());
107
108 let datasource_catalog: Arc<dyn DatasourceCatalog> = Arc::new(RuntimeDatasourceCatalog::new(
110 std::collections::HashMap::new(),
111 ));
112
113 register_bundle_empty!(ctx, camel_component_http::HttpBundle);
115 #[cfg(feature = "http-static")]
116 register_bundle_empty!(ctx, camel_component_http::HttpStaticBundle);
117 register_bundle_empty!(ctx, camel_component_ws::WsBundle);
118 register_bundle_empty!(ctx, camel_component_file::FileBundle);
119 register_bundle_empty!(ctx, camel_component_container::ContainerBundle);
120 register_bundle_empty!(ctx, camel_template::TemplateBundle);
121 register_bundle_empty!(ctx, camel_master::MasterBundle);
122 register_bundle_empty!(ctx, camel_component_opensearch::OpenSearchBundle);
123 register_bundle_empty!(ctx, camel_component_redis::RedisBundle);
124
125 register_bundle_empty!(ctx, camel_component_jms::JmsBundle);
128 register_bundle_empty!(ctx, camel_component_cxf::CxfBundle);
129
130 register_datasource_bundle_empty!(ctx, camel_component_sql::SqlBundle, datasource_catalog);
132 #[cfg(feature = "surrealdb")]
133 register_datasource_bundle_empty!(
134 ctx,
135 camel_component_surrealdb::SurrealDbBundle,
136 datasource_catalog
137 );
138
139 #[cfg(feature = "kafka")]
141 register_bundle_empty!(ctx, camel_component_kafka::KafkaBundle);
142 #[cfg(feature = "mqtt")]
143 register_bundle_empty!(ctx, camel_component_mqtt::MqttBundle);
144 #[cfg(feature = "grpc")]
145 register_bundle_empty!(ctx, camel_component_grpc::GrpcBundle);
146 #[cfg(feature = "llm")]
147 register_bundle_empty!(ctx, camel_component_llm::LlmBundle);
148
149 }