Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions apps/framework-cli/src/cli/display/infrastructure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,15 +670,6 @@ pub fn show_process_changes(process_changes: &[ProcessChange]) {
ProcessChange::OlapProcess(olap_change) => {
handle_standard_change!(olap_change);
}
ProcessChange::ConsumptionApiWebServer(Change::Added(_)) => {
infra_added("Starting Consumption WebServer...");
}
ProcessChange::ConsumptionApiWebServer(Change::Removed(_)) => {
infra_removed("Stopping Consumption WebServer...");
}
ProcessChange::ConsumptionApiWebServer(Change::Updated { .. }) => {
infra_updated("Reloading Consumption WebServer...");
}
ProcessChange::OrchestrationWorker(Change::Added(_)) => {
infra_added("Starting Orchestration worker...");
}
Expand Down
5 changes: 3 additions & 2 deletions apps/framework-cli/src/cli/routines/openapi.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::framework::consumption::model::ConsumptionQueryParam;
use crate::framework::core::infrastructure::api_endpoint::{APIType, ApiEndpoint};
use crate::framework::core::infrastructure::api_endpoint::{
APIType, ApiEndpoint, ConsumptionQueryParam,
};
use crate::framework::core::infrastructure::table::ColumnType;
use crate::framework::core::infrastructure_map::InfrastructureMap;
use crate::project::Project;
Expand Down
1 change: 0 additions & 1 deletion apps/framework-cli/src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use clap::Subcommand;

pub mod blocks;
pub mod bulk_import;
pub mod consumption;
pub mod core;
pub mod data_model;
pub mod languages;
Expand Down
88 changes: 0 additions & 88 deletions apps/framework-cli/src/framework/consumption/loader.rs

This file was deleted.

54 changes: 0 additions & 54 deletions apps/framework-cli/src/framework/consumption/model.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ impl<T: OlapOperations> InfraRealityChecker<T> {
mod tests {
use super::*;
use crate::cli::local_webserver::LocalWebserverConfig;
use crate::framework::core::infrastructure::consumption_webserver::ConsumptionApiWebServer;
use crate::framework::core::infrastructure::olap_process::OlapProcess;
use crate::framework::core::infrastructure::table::{
Column, ColumnType, IntType, OrderBy, Table,
Expand Down Expand Up @@ -443,7 +442,6 @@ mod tests {
topic_to_topic_sync_processes: HashMap::new(),
function_processes: HashMap::new(),
block_db_processes: OlapProcess {},
consumption_api_web_server: ConsumptionApiWebServer {},
orchestration_workers: HashMap::new(),
sql_resources: HashMap::new(),
workflows: HashMap::new(),
Expand Down Expand Up @@ -511,7 +509,6 @@ mod tests {
topic_to_topic_sync_processes: HashMap::new(),
function_processes: HashMap::new(),
block_db_processes: OlapProcess {},
consumption_api_web_server: ConsumptionApiWebServer {},
orchestration_workers: HashMap::new(),
sql_resources: HashMap::new(),
workflows: HashMap::new(),
Expand Down Expand Up @@ -585,7 +582,6 @@ mod tests {
topic_to_topic_sync_processes: HashMap::new(),
function_processes: HashMap::new(),
block_db_processes: OlapProcess {},
consumption_api_web_server: ConsumptionApiWebServer {},
orchestration_workers: HashMap::new(),
sql_resources: HashMap::new(),
workflows: HashMap::new(),
Expand Down Expand Up @@ -652,7 +648,6 @@ mod tests {
topic_to_topic_sync_processes: HashMap::new(),
function_processes: HashMap::new(),
block_db_processes: OlapProcess {},
consumption_api_web_server: ConsumptionApiWebServer {},
orchestration_workers: HashMap::new(),
sql_resources: HashMap::new(),
workflows: HashMap::new(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::table::ColumnType;
use super::table::Metadata;
use super::{topic::Topic, DataLineage, InfrastructureSignature};
use crate::framework::versions::Version;
use crate::framework::{
consumption::model::{ConsumptionQueryParam, EndpointFile},
core::infrastructure_map::{PrimitiveSignature, PrimitiveTypes},
data_model::model::DataModel,
};
Expand All @@ -12,12 +12,57 @@ use crate::proto::infrastructure_map::Method as ProtoMethod;
use crate::proto::infrastructure_map::{
ApiEndpoint as ProtoApiEndpoint, EgressDetails, IngressDetails,
};
use hex::encode;
use protobuf::{EnumOrUnknown, MessageField};
use serde::de::Error;
use serde::{Deserialize, Deserializer, Serialize};
use serde_json::Value;
use sha2::{digest::Output, Sha256};
use std::path::PathBuf;

/// Query parameter definition for consumption APIs
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConsumptionQueryParam {
pub name: String,
pub data_type: ColumnType,
pub required: bool,
}

impl ConsumptionQueryParam {
pub fn to_proto(&self) -> crate::proto::infrastructure_map::ConsumptionQueryParam {
crate::proto::infrastructure_map::ConsumptionQueryParam {
name: self.name.clone(),
data_type: MessageField::some(self.data_type.to_proto()),
required: self.required,
special_fields: Default::default(),
}
}

pub fn from_proto(proto: crate::proto::infrastructure_map::ConsumptionQueryParam) -> Self {
ConsumptionQueryParam {
name: proto.name,
data_type: ColumnType::from_proto(proto.data_type.unwrap()),
required: proto.required,
}
}
}

/// Endpoint file definition (used by DMV1 only, kept for compatibility)
#[derive(Debug, Clone, Default)]
pub struct EndpointFile {
pub path: PathBuf,
pub hash: Output<Sha256>,
pub query_params: Vec<ConsumptionQueryParam>,
pub output_schema: Value,
pub version: Option<String>,
}

impl EndpointFile {
pub fn id(&self) -> String {
format!("{}-{}", self.path.to_string_lossy(), encode(self.hash))
}
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum APIType {
INGRESS {
Expand Down
Loading
Loading