forked from github-starred/komodo
add additional typescript type gen from core
This commit is contained in:
@@ -5,8 +5,9 @@ use axum::{
|
||||
Extension, Json, Router,
|
||||
};
|
||||
use helpers::handle_anyhow_error;
|
||||
use mungos::{Deserialize, Document};
|
||||
use mungos::{Deserialize, Document, Serialize};
|
||||
use types::{traits::Permissioned, Build, PermissionLevel};
|
||||
use typeshare::typeshare;
|
||||
|
||||
use crate::{
|
||||
auth::{RequestUser, RequestUserExtension},
|
||||
@@ -14,12 +15,14 @@ use crate::{
|
||||
state::{State, StateExtension},
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct BuildId {
|
||||
id: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct CreateBuildBody {
|
||||
name: String,
|
||||
server_id: String,
|
||||
|
||||
@@ -8,8 +8,9 @@ use axum::{
|
||||
};
|
||||
use futures_util::future::join_all;
|
||||
use helpers::handle_anyhow_error;
|
||||
use mungos::{Deserialize, Document};
|
||||
use mungos::{Deserialize, Document, Serialize};
|
||||
use types::{traits::Permissioned, Deployment, DeploymentWithContainer, PermissionLevel, Server};
|
||||
use typeshare::typeshare;
|
||||
|
||||
use crate::{
|
||||
auth::{RequestUser, RequestUserExtension},
|
||||
@@ -17,12 +18,14 @@ use crate::{
|
||||
state::{State, StateExtension},
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct DeploymentId {
|
||||
id: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct CreateDeploymentBody {
|
||||
name: String,
|
||||
server_id: String,
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
use anyhow::{anyhow, Context};
|
||||
use axum::{routing::post, Extension, Json, Router};
|
||||
use helpers::handle_anyhow_error;
|
||||
use mungos::{doc, Deserialize, Document, Update};
|
||||
use mungos::{doc, Deserialize, Document, Update, Serialize};
|
||||
use types::{Build, Deployment, PermissionLevel, PermissionsTarget, Server};
|
||||
use typeshare::typeshare;
|
||||
|
||||
use crate::{auth::RequestUserExtension, state::StateExtension};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct PermissionsUpdateBody {
|
||||
user_id: String,
|
||||
permission: PermissionLevel,
|
||||
@@ -14,7 +16,8 @@ struct PermissionsUpdateBody {
|
||||
target_id: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct ModifyUserEnabledBody {
|
||||
user_id: String,
|
||||
enabled: bool,
|
||||
|
||||
@@ -5,8 +5,9 @@ use axum::{
|
||||
Extension, Json, Router,
|
||||
};
|
||||
use helpers::handle_anyhow_error;
|
||||
use mungos::{Deserialize, Document};
|
||||
use mungos::{Deserialize, Document, Serialize};
|
||||
use types::{traits::Permissioned, PermissionLevel, Procedure};
|
||||
use typeshare::typeshare;
|
||||
|
||||
use crate::{
|
||||
auth::{RequestUser, RequestUserExtension},
|
||||
@@ -14,12 +15,13 @@ use crate::{
|
||||
state::{State, StateExtension},
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct ProcedureId {
|
||||
id: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct CreateProcedureBody {
|
||||
name: String,
|
||||
}
|
||||
|
||||
@@ -5,21 +5,24 @@ use axum::{
|
||||
Extension, Json, Router,
|
||||
};
|
||||
use helpers::{generate_secret, handle_anyhow_error};
|
||||
use mungos::{doc, to_bson, Deserialize, Document, Update};
|
||||
use mungos::{doc, to_bson, Deserialize, Document, Update, Serialize};
|
||||
use types::{monitor_timestamp, ApiSecret};
|
||||
use typeshare::typeshare;
|
||||
|
||||
use crate::{auth::RequestUserExtension, state::StateExtension};
|
||||
|
||||
const SECRET_LENGTH: usize = 40;
|
||||
const BCRYPT_COST: u32 = 10;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct CreateSecretBody {
|
||||
name: String,
|
||||
expires: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct DeleteSecretPath {
|
||||
name: String,
|
||||
}
|
||||
|
||||
@@ -5,11 +5,12 @@ use axum::{
|
||||
Extension, Json, Router,
|
||||
};
|
||||
use helpers::handle_anyhow_error;
|
||||
use mungos::{Deserialize, Document};
|
||||
use mungos::{Deserialize, Document, Serialize};
|
||||
use types::{
|
||||
traits::Permissioned, BasicContainerInfo, ImageSummary, Log, Network, PermissionLevel, Server,
|
||||
SystemStats,
|
||||
};
|
||||
use typeshare::typeshare;
|
||||
|
||||
use crate::{
|
||||
auth::{RequestUser, RequestUserExtension},
|
||||
@@ -17,12 +18,14 @@ use crate::{
|
||||
state::{State, StateExtension},
|
||||
};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct ServerId {
|
||||
id: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[typeshare]
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct CreateServerBody {
|
||||
name: String,
|
||||
address: String,
|
||||
|
||||
Reference in New Issue
Block a user