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
68 changes: 19 additions & 49 deletions backend/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ diesel-async = { version = "0.7", features = ["migrations", "postgres", "bb8"] }
diesel-derive-enum = { version = "3.0.0-beta.1", features = ["postgres"] }
diesel_migrations = "2.3"
futures = "0.3"
geoengine-openapi-client = { git = "https://github.com/geo-engine/openapi-client", branch = "rust" }
geoengine-api-client = { git = "https://github.com/geo-engine/openapi-client", branch = "rust2" }
indoc = "2.0"
nom = "8.0"
ogcapi = { git = "https://github.com/georust/ogcapi", branch = "openapi-fixes", default-features = false, features = [
Expand Down
12 changes: 6 additions & 6 deletions backend/examples/query-geo-engine.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![allow(clippy::unwrap_used, clippy::print_stderr)] // ok for example

use geoengine_openapi_client::{
use geoengine_api_client::{
apis::{
configuration::Configuration, general_api::server_info_handler, ogcwfs_api::wfs_handler,
session_api::anonymous_handler, workflows_api::register_workflow_handler,
},
models::{
Coordinate2D, SpatialPartition2D, TypedOperatorOperator, WfsRequest, WfsService, Workflow,
workflow::Type,
Coordinate2D, LegacyTypedOperator, LegacyTypedOperatorOperator, SpatialPartition2D,
WfsRequest, WfsService, Workflow, legacy_typed_operator::Type,
},
};

Expand All @@ -22,16 +22,16 @@ async fn main() {
eprintln!("{session:#?}");
configuration.bearer_access_token = Some(session.id.to_string());

let workflow = Workflow {
operator: Box::new(TypedOperatorOperator {
let workflow = Workflow::LegacyTypedOperator(Box::new(LegacyTypedOperator {
operator: Box::new(LegacyTypedOperatorOperator {
params: Some(serde_json::json!({
"data": "ne_10m_ports"
})),
sources: None,
r#type: "OgrSource".into(),
}),
r#type: Type::Vector,
};
}));

let workflow_id = register_workflow_handler(&configuration, workflow)
.await
Expand Down
12 changes: 6 additions & 6 deletions backend/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use axum::{
response::IntoResponse,
};
use futures::future::BoxFuture;
use geoengine_openapi_client::apis::{configuration, session_api::session_handler};
use geoengine_api_client::apis::{configuration, session_api::session_handler};
use nom::{
IResult, Parser,
bytes::{complete::tag_no_case, take},
Expand Down Expand Up @@ -40,7 +40,7 @@ pub struct AuthCodeResponse {
pub state: String,
}

impl From<AuthCodeResponse> for geoengine_openapi_client::models::AuthCodeResponse {
impl From<AuthCodeResponse> for geoengine_api_client::models::AuthCodeResponse {
fn from(value: AuthCodeResponse) -> Self {
Self {
code: value.code,
Expand All @@ -60,8 +60,8 @@ pub struct UserSession {
pub valid_until: String,
}

impl From<geoengine_openapi_client::models::UserSession> for UserSession {
fn from(value: geoengine_openapi_client::models::UserSession) -> Self {
impl From<geoengine_api_client::models::UserSession> for UserSession {
fn from(value: geoengine_api_client::models::UserSession) -> Self {
Self {
created: value.created,
id: value.id,
Expand Down Expand Up @@ -187,7 +187,7 @@ where
Ok(session) => session,
Err(error) => {
let (error_msg, status_code) = match &error {
geoengine_openapi_client::apis::Error::ResponseError(e) => (
geoengine_api_client::apis::Error::ResponseError(e) => (
error_response(&error)
.map(|e| e.message)
.unwrap_or_default(),
Expand Down Expand Up @@ -248,7 +248,7 @@ mod tests {
use axum::body::Body;
use axum::http::Request as HttpRequest;
use axum::response::Response;
use geoengine_openapi_client::apis::configuration;
use geoengine_api_client::apis::configuration;
use httptest::matchers::*;
use httptest::responders::*;
use httptest::{Expectation, Server};
Expand Down
2 changes: 1 addition & 1 deletion backend/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::util::Secret;
use geoengine_openapi_client::apis::configuration::Configuration;
use geoengine_api_client::apis::configuration::Configuration;
use std::{path::Path, sync::LazyLock};
use tracing::Level;
use tracing_subscriber::filter::Directive;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use axum::{
http::StatusCode,
response::IntoResponse,
};
use geoengine_openapi_client::apis::{
use geoengine_api_client::apis::{
configuration::Configuration,
session_api::{oidc_init, oidc_login},
};
Expand Down
14 changes: 8 additions & 6 deletions backend/src/processes/ndvi.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{Context, Result};
use geoengine_openapi_client::{
use geoengine_api_client::{
apis::{
configuration::Configuration, ogcwfs_api::wfs_handler, uploads_api::upload_handler,
workflows_api::register_workflow_handler,
Expand Down Expand Up @@ -340,18 +340,20 @@ async fn compute_ndvi(
.into(),
}
.into(),
))?;
));

// eprintln!("{}", serde_json::to_string_pretty(&workflow).unwrap());

let workflow_id = match register_workflow_handler(configuration, workflow).await {
let workflow_id = match register_workflow_handler(configuration, workflow.clone()).await {
Ok(id) => id,
Err(e) => {
let workflow_json = serde_json::to_string_pretty(&workflow)
.unwrap_or_else(|_| "<failed to serialize workflow>".to_string());
if let Some(error) = error_response(&e) {
anyhow::bail!("Failed to register workflow: {error:?}");
anyhow::bail!("Failed to register workflow `{workflow_json}`: {error:?}");
}

anyhow::bail!("Failed to register workflow: {e}");
anyhow::bail!("Failed to register workflow `{workflow_json}`: {e}");
}
};

Expand Down Expand Up @@ -508,7 +510,7 @@ fn k_ndvi_source() -> RasterOperator {
#[cfg(test)]
mod tests {
use super::*;
use geoengine_openapi_client::apis::configuration::Configuration as ApiConfiguration;
use geoengine_api_client::apis::configuration::Configuration as ApiConfiguration;
use httptest::matchers::*;
use httptest::responders::*;
use httptest::{Expectation, Server};
Expand Down
4 changes: 2 additions & 2 deletions backend/src/processes/parameters.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use geoengine_openapi_client::models::SpatialPartition2D;
use geoengine_api_client::models::SpatialPartition2D;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
Expand All @@ -13,7 +13,7 @@ pub trait ToBbox {

impl ToBbox for Coordinate {
fn to_bbox(&self, buffer: f64) -> SpatialPartition2D {
use geoengine_openapi_client::models::Coordinate2D;
use geoengine_api_client::models::Coordinate2D;

let [x, y] = self.0;
SpatialPartition2D::new(
Expand Down
Loading
Loading