Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: allow passing ids to connections api create methods #94

Merged
merged 2 commits into from
Jul 22, 2024
Merged
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
1 change: 1 addition & 0 deletions integrationos-api/src/endpoints/common_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ pub fn get_router() -> Router<Arc<AppState>> {
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub name: String,
pub version: Version,
pub fields: Vec<Field>,
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/src/endpoints/connection_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub fn get_router() -> Router<Arc<AppState>> {
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub platform: String,
pub platform_version: String,
#[serde(default)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ pub async fn test_connection_model_definition(
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub connection_platform: String,
pub connection_definition_id: Id,
pub platform_version: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ pub async fn get_platform_models(
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub platform_id: Id,
pub platform_page_id: Id,
pub connection_platform: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub fn get_router() -> Router<Arc<AppState>> {
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateRequest {
pub _id: Option<Id>,
pub connection_platform: String,
pub platform_redirect_uri: String,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
2 changes: 1 addition & 1 deletion integrationos-api/src/endpoints/unified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use convert_case::{Case, Casing};
use http::{HeaderMap, HeaderName};
use integrationos_domain::{
connection_model_definition::CrudAction, destination::Action,
encrypted_access_key::EncryptedAccessKey, encrypted_data::PASSWORD_LENGTH, environment,
encrypted_access_key::EncryptedAccessKey, encrypted_data::PASSWORD_LENGTH,
event_access::EventAccess, AccessKey, ApplicationError, Event, InternalError,
};
use serde::{Deserialize, Serialize};
Expand Down
2 changes: 2 additions & 0 deletions integrationos-api/tests/api_tests/get_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async fn test_get_expanded_common_model() {
let reference: String = Faker.fake();

let base = common_model::CreateRequest {
_id: None,
name: Faker.fake(),
version: Faker.fake(),
fields: vec![
Expand Down Expand Up @@ -72,6 +73,7 @@ async fn test_get_expanded_common_model() {
};

let expandable = common_model::CreateRequest {
_id: None,
name: reference.clone(),
version: Faker.fake(),
fields: vec![],
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/tests/api_tests/passthrough_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async fn test_passthrough_api() {
.create();

let create_model_definition_payload = CreateConnectionModelDefinitionRequest {
_id: None,
connection_platform: connection.platform.to_string(),
connection_definition_id: conn_def.id,
platform_version: conn_def.record_metadata.version.to_string(),
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/tests/api_tests/test_server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ impl TestServer {
assert!(!connection.secrets_service_id.is_empty());

let model_def = CreateConnectionModelDefinitionRequest {
_id: None,
connection_platform: connection_def.platform,
connection_definition_id: connection_def.id,
platform_version: connection_def.platform_version,
Expand Down
1 change: 1 addition & 0 deletions integrationos-api/tests/api_tests/unified_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ async fn create_connection_model_definition(
.await;

let create_model_definition_payload = CreateConnectionModelDefinitionRequest {
_id: None,
connection_platform: connection.platform.to_string(),
connection_definition_id: connection.connection_definition_id,
platform_version: connection.record_metadata.version.to_string(),
Expand Down
2 changes: 1 addition & 1 deletion integrationos-unified/src/unified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use mongodb::{
options::{Collation, CollationStrength, FindOneOptions},
Client,
};
use serde_json::{json, Map, Number, Value};
use serde_json::{json, Number, Value};
use std::{cell::RefCell, collections::HashMap, str::FromStr, sync::Arc};
use tracing::{debug, error};

Expand Down
Loading