diff --git a/Cargo.lock b/Cargo.lock index 1163f5d..caf9c77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -933,20 +933,15 @@ dependencies = [ ] [[package]] -name = "ndc-client" -version = "0.1.1" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.1#17c61946cc9a3ff6dcee1d535af33141213b639a" +name = "ndc-models" +version = "0.1.2" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.2#6e7d12a31787d5f618099a42ddc0bea786438c00" dependencies = [ - "async-trait", "indexmap 2.2.6", - "opentelemetry", - "reqwest", "schemars", "serde", - "serde_derive", "serde_json", "serde_with", - "url", ] [[package]] @@ -961,7 +956,7 @@ dependencies = [ "clap", "http", "mime", - "ndc-client", + "ndc-models", "ndc-test", "opentelemetry", "opentelemetry-http", @@ -983,14 +978,14 @@ dependencies = [ [[package]] name = "ndc-test" -version = "0.1.1" -source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.1#17c61946cc9a3ff6dcee1d535af33141213b639a" +version = "0.1.2" +source = "git+http://github.com/hasura/ndc-spec.git?tag=v0.1.2#6e7d12a31787d5f618099a42ddc0bea786438c00" dependencies = [ "async-trait", "clap", "colorful", "indexmap 2.2.6", - "ndc-client", + "ndc-models", "rand", "reqwest", "semver", @@ -998,6 +993,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", + "url", ] [[package]] diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml index 849e975..4e19f76 100644 --- a/crates/sdk/Cargo.toml +++ b/crates/sdk/Cargo.toml @@ -18,14 +18,14 @@ path = "bin/main.rs" [features] default = ["native-tls", "ndc-test"] -native-tls = ["ndc-client/native-tls", "ndc-test/native-tls", "reqwest/native-tls"] -rustls = ["ndc-client/rustls", "ndc-test/rustls", "reqwest/rustls"] +native-tls = ["reqwest/native-tls"] +rustls = ["reqwest/rustls"] ndc-test = ["dep:ndc-test"] [dependencies] -ndc-client = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.1" } -ndc-test = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.1", optional = true } +ndc-models = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.2" } +ndc-test = { git = "http://github.com/hasura/ndc-spec.git", tag = "v0.1.2", optional = true } async-trait = "0.1.79" axum = "0.6.20" diff --git a/crates/sdk/src/connector.rs b/crates/sdk/src/connector.rs index f457f15..2dbaf95 100644 --- a/crates/sdk/src/connector.rs +++ b/crates/sdk/src/connector.rs @@ -3,7 +3,7 @@ use std::fmt::Display; use std::path::{Path, PathBuf}; use async_trait::async_trait; -use ndc_client::models; +use ndc_models as models; use serde::Serialize; use thiserror::Error; diff --git a/crates/sdk/src/default_main.rs b/crates/sdk/src/default_main.rs index 34add04..7debf3e 100644 --- a/crates/sdk/src/default_main.rs +++ b/crates/sdk/src/default_main.rs @@ -15,7 +15,7 @@ use clap::{Parser, Subcommand}; use prometheus::Registry; use tower_http::{trace::TraceLayer, validate_request::ValidateRequestHeaderLayer}; -use ndc_client::models::{ +use ndc_models::{ CapabilitiesResponse, ErrorResponse, ExplainResponse, MutationRequest, MutationResponse, QueryRequest, QueryResponse, SchemaResponse, }; @@ -438,16 +438,14 @@ mod ndc_test_commands { impl ndc_test::connector::Connector for ConnectorAdapter { async fn get_capabilities( &self, - ) -> Result { + ) -> Result { C::get_capabilities() .await .into_value::>() .map_err(|err| ndc_test::error::Error::OtherError(err)) } - async fn get_schema( - &self, - ) -> Result { + async fn get_schema(&self) -> Result { match C::get_schema(&self.configuration).await { Ok(response) => response .into_value::>() @@ -458,8 +456,8 @@ mod ndc_test_commands { async fn query( &self, - request: ndc_client::models::QueryRequest, - ) -> Result { + request: ndc_models::QueryRequest, + ) -> Result { match C::query(&self.configuration, &self.state, request) .await .and_then(JsonResponse::into_value) @@ -471,8 +469,8 @@ mod ndc_test_commands { async fn mutation( &self, - request: ndc_client::models::MutationRequest, - ) -> Result { + request: ndc_models::MutationRequest, + ) -> Result { match C::mutation(&self.configuration, &self.state, request) .await .and_then(JsonResponse::into_value) diff --git a/crates/sdk/src/json_rejection.rs b/crates/sdk/src/json_rejection.rs index 4a30e83..05346b3 100644 --- a/crates/sdk/src/json_rejection.rs +++ b/crates/sdk/src/json_rejection.rs @@ -2,7 +2,7 @@ use axum::extract; use axum::response::IntoResponse; -use ndc_client::models; +use ndc_models as models; pub struct JsonRejection(extract::rejection::JsonRejection); diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs index 5a1f3d2..f4d54c7 100644 --- a/crates/sdk/src/lib.rs +++ b/crates/sdk/src/lib.rs @@ -6,4 +6,4 @@ pub mod json_response; pub mod routes; pub mod tracing; -pub use ndc_client::models; +pub use ndc_models as models; diff --git a/crates/sdk/src/routes.rs b/crates/sdk/src/routes.rs index cd5f770..fb755b5 100644 --- a/crates/sdk/src/routes.rs +++ b/crates/sdk/src/routes.rs @@ -1,5 +1,5 @@ use axum::{http::StatusCode, Json}; -use ndc_client::models; +use ndc_models as models; use prometheus::{Registry, TextEncoder}; use crate::{