Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-verification-status-to-cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
paulkr committed May 29, 2024
2 parents e4b82bb + 07e5b55 commit 4ae8d0b
Show file tree
Hide file tree
Showing 15 changed files with 307 additions and 264 deletions.
64 changes: 31 additions & 33 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"integrationos-event",
"integrationos-gateway",
"integrationos-watchdog",
"integrationos-unified",
]

[workspace.dependencies]
Expand Down
3 changes: 2 additions & 1 deletion integrationos-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ http-serde-ext.workspace = true
http.workspace = true
hyper = "0.14.27"
indexmap = "2.1.0"
integrationos-unified = { path = "../integrationos-unified" }
integrationos-cache = { path = "../integrationos-cache" }
integrationos-domain = { path = "../integrationos-domain", features = [ "unified", "metrics", "axum-error", ] }
integrationos-domain = { path = "../integrationos-domain", features = [ "metrics", "axum-error", ] }
jsonwebtoken.workspace = true
mongodb.workspace = true
num_cpus = "1"
Expand Down
2 changes: 1 addition & 1 deletion integrationos-api/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use integrationos_cache::local::{
};
use integrationos_domain::{
algebra::{CryptoExt, DefaultTemplate, MongoStore},
client::unified_destination_client::UnifiedDestination,
common_model::{CommonEnum, CommonModel},
connection_definition::{ConnectionDefinition, PublicConnectionDetails},
connection_model_definition::ConnectionModelDefinition,
Expand All @@ -27,6 +26,7 @@ use integrationos_domain::{
stage::Stage,
Connection, Event, Pipeline, PlatformData, Store, Transaction,
};
use integrationos_unified::unified::UnifiedDestination;
use mongodb::{options::UpdateOptions, Client, Database};
use segment::{AutoBatcher, Batcher, HttpClient};
use std::{sync::Arc, time::Duration};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use moka::future::Cache;
use mongodb::bson::Document;
use std::{sync::Arc, time::Duration};

#[derive(Clone)]
pub struct ConnectionModelDefinitionCache {
inner: Arc<Cache<Id, ConnectionModelDefinition>>,
}
Expand Down
19 changes: 3 additions & 16 deletions integrationos-domain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@ edition = "2021"
repository = "https://github.com/integration-os/integrationos-domain"

[features]
default = ["unified"]

# This feature can be used for tests to provide dummy implementations
dummy = ["dep:fake"]

# This feature provides access to unified-destination functionality.
unified = ["metrics", "dep:handlebars", "dep:moka"]

# This feature is for using napi to export structs to an npm package
napi = ["dep:napi", "dep:napi-derive"]

# This feature allows you to measure the time it takes to execute a future
metrics = ["dep:pin-project"]

Expand All @@ -36,7 +28,6 @@ anyhow = "1.0.79"
async-recursion = "1.0.5"
async-trait = "0.1.77"
axum = { version = "0.7.5", optional = true }
base64 = "0.21.7"
base64ct = { version = "1.6.0", features = ["alloc"] }
bson = "2.9.0"
chrono = { version = "0.4.32", features = ["serde"] }
Expand All @@ -52,22 +43,18 @@ fake = { version = "2.9.2", features = [
"semver",
], optional = true }
futures = "0.3.30"
handlebars = { version = "4.4.0", optional = true }
handlebars = { version = "4.4.0" }
http = "1.1.0"
http-serde-ext = "1.0.2"
indexmap = "2.1.0"
js-sandbox-ios = "0.1.0"
moka = { workspace = true, optional = true }
mongodb = "2.8.0"
napi = { version = "2.14.2", default-features = false, features = [
"napi4",
], optional = true }
napi-derive = { version = "2.14.6", optional = true }
napi = { version = "2.14.2", default-features = false, features = [ "napi4" ] }
napi-derive = { version = "2.14.6" }
openapiv3 = "2.0.0"
pin-project = { version = "1.1.4", optional = true }
prost = "0.12.3"
rand = "0.8.5"
redis = { version = "0.23.3", features = ["connection-manager", "tokio-comp"] }
reqwest = { version = "0.12.3", features = [
"json",
"rustls-tls",
Expand Down
6 changes: 2 additions & 4 deletions integrationos-domain/src/domain/access_key/access_key_data.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
#[cfg(feature = "napi")]
use napi_derive::napi;

use crate::{IntegrationOSError, InternalError};
use napi_derive::napi;
use prost::Message;

#[derive(Clone, Eq, PartialEq, prost::Message)]
#[napi(object)]
#[cfg_attr(feature = "dummy", derive(fake::Dummy))]
#[cfg_attr(feature = "napi", napi(object))]
pub struct AccessKeyData {
#[prost(string, tag = "1")]
pub id: String,
Expand Down
2 changes: 0 additions & 2 deletions integrationos-domain/src/service/client/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
pub mod caller_client;
pub mod secrets_client;
#[cfg(feature = "unified")]
pub mod unified_destination_client;
3 changes: 2 additions & 1 deletion integrationos-event/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ futures.workspace = true
handlebars.workspace = true
http.workspace = true
integrationos-cache = { path = "../integrationos-cache" }
integrationos-domain = { path = "../integrationos-domain", features = ["unified"] }
integrationos-domain = { path = "../integrationos-domain" }
integrationos-unified = { path = "../integrationos-unified" }
js-sandbox-ios.workspace = true
metrics = "0.21.1"
metrics-exporter-prometheus = "0.12.1"
Expand Down
2 changes: 1 addition & 1 deletion integrationos-event/src/mongo_control_data_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use handlebars::Handlebars;
use http::header::AUTHORIZATION;
use integrationos_domain::{
algebra::{CryptoExt, FecherExt, GoogleTokenFetcher, MongoStore},
client::unified_destination_client::UnifiedDestination,
duplicates::Duplicates,
encrypted_access_key::EncryptedAccessKey,
event_access::EventAccess,
Expand All @@ -19,6 +18,7 @@ use integrationos_domain::{
middleware::Middleware,
Connection, Event, Pipeline, Store,
};
use integrationos_unified::unified::UnifiedDestination;
use moka::future::Cache;
use mongodb::{options::ClientOptions, Client};
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
Expand Down
30 changes: 30 additions & 0 deletions integrationos-unified/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "integrationos-unified"
description = "Unified service library for IntegrationOS"
version = "0.1.0"
edition = "2021"

[dependencies]
jsonpath_lib = "0.3.0"
bson = "2.9.0"
chrono = { version = "0.4.32", features = ["serde"] }
integrationos-domain = { path = "../integrationos-domain" }
futures = "0.3.30"
handlebars = { version = "4.4.0" }
http = "1.1.0"
http-serde-ext = "1.0.2"
js-sandbox-ios = "0.1.0"
moka.workspace = true
mongodb = "2.8.0"
reqwest = { version = "0.12.3", features = [
"json",
"rustls-tls",
], default-features = false }
serde = { version = "1.0.195", features = ["derive", "rc"] }
serde_json = "1.0.111"
tokio = { version = "1.35.1", features = ["macros", "rt-multi-thread"] }
tracing = "0.1.40"
uuid = { version = "1.7.0", features = ["v4"] }

[lib]
path = "src/lib.rs"
3 changes: 3 additions & 0 deletions integrationos-unified/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod request;
pub mod unified;
pub mod utility;
51 changes: 51 additions & 0 deletions integrationos-unified/src/request.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
use bson::doc;
use http::HeaderMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;

#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct RequestCrudBorrowed<'a> {
pub query_params: &'a HashMap<String, String>,
#[serde(with = "http_serde_ext::header_map", default)]
pub headers: &'a HeaderMap,
pub path_params: Option<PathParams<'a>>,
}

#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PathParams<'a> {
pub id: &'a str,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RequestCrud {
pub query_params: Option<HashMap<String, String>>,
#[serde(with = "http_serde_ext::header_map", default)]
pub headers: HeaderMap,
pub path_params: Option<HashMap<String, String>>,
pub body: Option<Value>,
}

#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ResponseCrudToMap<'a> {
#[serde(with = "http_serde_ext::header_map")]
pub headers: &'a HeaderMap,
pub pagination: Option<Value>,
pub request: ResponseCrudToMapRequest<'a>,
}

#[derive(Debug, Clone, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct ResponseCrudToMapRequest<'a> {
pub query_params: &'a HashMap<String, String>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ResponseCrud {
pub pagination: Option<Value>,
}
Loading

0 comments on commit 4ae8d0b

Please sign in to comment.