add: littleweb api + scopes
This commit is contained in:
parent
c4de17058b
commit
3fc0872867
9 changed files with 598 additions and 11 deletions
|
@ -2,6 +2,7 @@ pub mod apps;
|
|||
pub mod auth;
|
||||
pub mod channels;
|
||||
pub mod communities;
|
||||
pub mod domains;
|
||||
pub mod journals;
|
||||
pub mod layouts;
|
||||
pub mod notes;
|
||||
|
@ -9,6 +10,7 @@ pub mod notifications;
|
|||
pub mod reactions;
|
||||
pub mod reports;
|
||||
pub mod requests;
|
||||
pub mod services;
|
||||
pub mod stacks;
|
||||
pub mod uploads;
|
||||
pub mod util;
|
||||
|
@ -28,6 +30,7 @@ use tetratto_core::model::{
|
|||
communities_permissions::CommunityPermission,
|
||||
journals::JournalPrivacyPermission,
|
||||
layouts::{CustomizablePage, LayoutPage, LayoutPrivacy},
|
||||
littleweb::{DomainData, DomainTld, ServiceFsEntry},
|
||||
oauth::AppScope,
|
||||
permissions::{FinePermission, SecondaryPermission},
|
||||
reactions::AssetType,
|
||||
|
@ -633,10 +636,22 @@ pub fn routes() -> Router {
|
|||
post(layouts::update_privacy_request),
|
||||
)
|
||||
.route("/layouts/{id}/pages", post(layouts::update_pages_request))
|
||||
// services
|
||||
.route("/services", get(services::list_request))
|
||||
.route("/services", post(services::create_request))
|
||||
.route("/services/{id}", get(services::get_request))
|
||||
.route("/services/{id}", delete(services::delete_request))
|
||||
.route("/services/{id}/files", post(services::update_files_request))
|
||||
// domains
|
||||
.route("/domains", get(domains::list_request))
|
||||
.route("/domains", post(domains::create_request))
|
||||
.route("/domains/{id}", get(domains::get_request))
|
||||
.route("/domains/{id}", delete(domains::delete_request))
|
||||
.route("/domains/{id}/data", post(domains::update_data_request))
|
||||
}
|
||||
|
||||
pub fn lw_routes() -> Router {
|
||||
Router::new()
|
||||
Router::new().route("/file", get(domains::get_file_request))
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
|
@ -1055,3 +1070,24 @@ pub struct UpdateLayoutPrivacy {
|
|||
pub struct UpdateLayoutPages {
|
||||
pub pages: Vec<LayoutPage>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct CreateService {
|
||||
pub name: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct UpdateServiceFiles {
|
||||
pub files: Vec<ServiceFsEntry>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct CreateDomain {
|
||||
pub name: String,
|
||||
pub tld: DomainTld,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct UpdateDomainData {
|
||||
pub data: Vec<(String, DomainData)>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue