-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
11 changed files
with
205 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
pub mod dependency_graph; | ||
pub mod loader; | ||
pub mod rpc; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::Value; | ||
use typegraph_core::{ | ||
types::{aws::*, core::RuntimeId}, | ||
Result, | ||
}; | ||
|
||
use super::TypegraphFunc; | ||
|
||
#[rustfmt::skip] | ||
#[derive(Debug, Serialize, Deserialize)] | ||
pub enum AwsCall { | ||
RegisterS3Runtime { data: S3RuntimeData }, | ||
S3PresignGet { runtime: RuntimeId, data: S3PresignGetParams }, | ||
S3PresignPut { runtime: RuntimeId, data: S3PresignPutParams }, | ||
S3List { runtime: RuntimeId, bucket: String }, | ||
S3Upload { runtime: RuntimeId, bucket: String }, | ||
S3UploadAll { runtime: RuntimeId, bucket: String }, | ||
} | ||
|
||
impl TypegraphFunc for AwsCall { | ||
fn execute(&self) -> Result<Value> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::Value; | ||
use typegraph_core::{types::core::*, Result}; | ||
|
||
use super::TypegraphFunc; | ||
|
||
#[rustfmt::skip] | ||
#[derive(Debug, Serialize, Deserialize)] | ||
pub enum CoreCall { | ||
InitTypegraph { params: TypegraphInitParams }, | ||
SerializeTypegraph { params: SerializeParams }, | ||
WithInjection { type_id: TypeId, injection: String }, | ||
Refb { name: String, attributes: Option<String> }, | ||
Integerb { data: TypeInteger, base: TypeBase }, | ||
Floatb { data: TypeFloat, base: TypeBase }, | ||
Booleanb { base: TypeBase }, | ||
Stringb { data: TypeString, base: TypeBase }, | ||
Fileb { data: TypeFile, base: TypeBase }, | ||
Listb { data: TypeList, base: TypeBase }, | ||
Optionalb { data: TypeOptional, base: TypeBase }, | ||
Unionb { data: TypeUnion, base: TypeBase }, | ||
Eitherb { data: TypeEither, base: TypeBase }, | ||
Strucutb { data: TypeStruct, base: TypeBase }, | ||
Funcb { data: TypeFunc }, | ||
ExtendStruct { type_id: TypeId, props: Vec<(String, Vec<TypeId>)> }, | ||
AsId { type_id: TypeId, composite: bool }, | ||
GetTypeRepr { type_id: TypeId }, | ||
GetTransformData { resolver_input: TypeId, transfrom_type: String }, | ||
RegisterPolicy { policy: Policy }, | ||
RegisterContextPolicy { key: String, check: ContextCheck }, | ||
WithPolicy { type_id: TypeId, policy_chain: Vec<PolicySpec> }, | ||
GetPublicPolicy, | ||
GetInternalPolicy, | ||
RenameType { type_id: TypeId, new_name: String }, | ||
Expose { fns: Vec<(String, TypeId)>, default_policy: Option<Vec<PolicySpec>> }, | ||
SetSeed { seed: Option<u32> }, | ||
} | ||
|
||
impl TypegraphFunc for CoreCall { | ||
fn execute(&self) -> Result<Value> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
mod aws; | ||
mod core; | ||
mod runtimes; | ||
mod utils; | ||
|
||
use enum_dispatch::enum_dispatch; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::Value; | ||
use typegraph_core::Result; | ||
|
||
#[enum_dispatch] | ||
pub trait TypegraphFunc { | ||
fn execute(&self) -> Result<Value>; | ||
} | ||
|
||
#[derive(Debug, Serialize, Deserialize)] | ||
#[serde(untagged)] | ||
#[enum_dispatch(TypegraphFunc)] | ||
pub enum TypegraphRpcCall { | ||
Core(core::CoreCall), | ||
Runtimes(runtimes::RuntimeCall), | ||
Aws(aws::AwsCall), | ||
Utils(utils::UtilsCall), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::Value; | ||
use typegraph_core::{ | ||
types::{ | ||
core::{RuntimeId, TypeId}, | ||
runtimes::*, | ||
}, | ||
Result, | ||
}; | ||
|
||
use super::TypegraphFunc; | ||
|
||
#[rustfmt::skip] | ||
#[derive(Debug, Serialize, Deserialize)] | ||
pub enum RuntimeCall { | ||
GetDenoRuntime, | ||
RegisterDenoFunc { data: MaterializerDenoFunc, effect: Effect }, | ||
RegisterDenoStatic { data: MaterializerDenoStatic, effect: Effect }, | ||
GetPredefindedDenoFunc { data: MaterializerDenoPredefined }, | ||
ImportDenoFunction { data: MaterializerDenoImport }, | ||
RegisterGraphqlRuntime { data: GraphqlRuntimeData }, | ||
GraphqlQuery { base: BaseMaterializer, data: MaterializerGraphqlQuery }, | ||
GraphqlMutation { base: BaseMaterializer, data: MaterializerGraphqlQuery }, | ||
RegisterHttpRuntime { data: HttpRuntimeData }, | ||
HttpRequest { base: BaseMaterializer, data: MaterializerHttpRequest }, | ||
RegisterPythonRuntime, | ||
FromPythonLambda { base: BaseMaterializer, data: MaterializerPythonLambda }, | ||
FromPythonDef { base: BaseMaterializer, data: MaterializerPythonDef }, | ||
FromPythonModule { base: BaseMaterializer, data: MaterializerPythonModule }, | ||
FromPythonImport { base: BaseMaterializer, data: MaterializerPythonImport }, | ||
RegisterRandomRuntime { data: RandomRuntimeData }, | ||
CreateRandomMat { base: BaseMaterializer, data: MaterializerRandom }, | ||
RegisterWasmReflectedRuntime { data: WasmRuntimeData }, | ||
FromWasmReflectedFunc { base: BaseMaterializer, data: MaterializerWasmReflectedFunc }, | ||
RegisterWasmWireRuntime { data: WasmRuntimeData }, | ||
FromWasmWireHandler { base: BaseMaterializer, data: MaterializerWasmWireHandler }, | ||
RegisterPrismaRuntime { data: PrismaRuntimeData }, | ||
PrismaFindUnique { runtime: RuntimeId, model: TypeId }, | ||
PrismaFindMany { runtime: RuntimeId, model: TypeId }, | ||
PrismaFindFirst { runtime: RuntimeId, model: TypeId }, | ||
PrismaAggregate { runtime: RuntimeId, model: TypeId }, | ||
PrismaCount { runtime: RuntimeId, model: TypeId }, | ||
PrismaGroupBy { runtime: RuntimeId, model: TypeId }, | ||
PrismaCreateOne { runtime: RuntimeId, model: TypeId }, | ||
PrismaCreateMany { runtime: RuntimeId, model: TypeId }, | ||
PrismaUpdateOne { runtime: RuntimeId, model: TypeId }, | ||
PrismaUpdateMany { runtime: RuntimeId, model: TypeId }, | ||
PrismaUpsertOne { runtime: RuntimeId, model: TypeId }, | ||
PrismaDeleteOne { runtime: RuntimeId, model: TypeId }, | ||
PrismaDeleteMany { runtime: RuntimeId, model: TypeId }, | ||
PrismaExecute { runtime: RuntimeId, query: String, param: TypeId, effect: Effect }, | ||
PrismaQueryRaw { runtime: RuntimeId, query: String, param: Option<TypeId>, out: TypeId }, | ||
PrismaLink { data: PrismaLinkData }, | ||
RegisterTemporalRuntime { data: TemporalRuntimeData }, | ||
GenerateTemporalOperation { runtime: RuntimeId, data: TemporalOperationData }, | ||
RegisterTypegateMaterializer { operation: TypegateOperation }, | ||
RegisterTypegraphMaterializer { operation: TypegraphOperation }, | ||
RegisterSubstantialRuntime { data: SubstantialRuntimeData }, | ||
GenerateSubstantialOperation { runtime: RuntimeId, data: SubstantialOperationData }, | ||
RegisterKvRuntime { data: KvRuntimeData }, | ||
KvOperation { base: BaseMaterializer, data: KvMaterializer }, | ||
RegisterGrpcRuntime { data: GrpcRuntimeData }, | ||
CallGrpcMethod { runtime: RuntimeId, data: GrpcData }, | ||
} | ||
|
||
impl TypegraphFunc for RuntimeCall { | ||
fn execute(&self) -> Result<Value> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::Value; | ||
use typegraph_core::{ | ||
types::{core::TypeId, utils::*}, | ||
Result, | ||
}; | ||
|
||
use super::TypegraphFunc; | ||
|
||
#[rustfmt::skip] | ||
#[derive(Debug, Serialize, Deserialize)] | ||
pub enum UtilsCall { | ||
GenReduceb { supertype_id: TypeId, data: Reduce }, | ||
AddGraphqlEndpoint { graphql: String }, | ||
AddAuth { data: Auth }, | ||
AddRawAuth { data: String }, | ||
Oauth2 { service_name: String, scopes: String }, | ||
Oauth2WithoutProfiler { service_name: String, scopes: String }, | ||
Oauth2WithExtendedProfiler { service_name: String, scopes: String, extension: String }, | ||
Oauth2WithCustomProfiler { service_name: String, scopes: String, profiler: TypeId }, | ||
GqlDeployQuery { params: QueryDeployParams }, | ||
GqlRemoveQuery { tg_name: Vec<String> }, | ||
MetagenExec { config: FdkConfig }, | ||
MetagenWriteFiles { items: Vec<FdkOutput>, typegraph_dir: String }, | ||
} | ||
|
||
impl TypegraphFunc for UtilsCall { | ||
fn execute(&self) -> Result<Value> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters