/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin */ use crate::{user::NodeUserData, Node}; use serde::{Deserialize, Serialize}; use std::sync::Arc; type NodesWithUdata = Vec<(Arc, NodeUserData)>; #[derive(Serialize, Deserialize)] pub struct ApiNodeResponse { pub parents: NodesWithUdata, pub children: NodesWithUdata, pub node: Arc, pub userdata: NodeUserData, } #[derive(Serialize, Deserialize)] pub struct ApiSearchResponse { pub count: usize, pub results: NodesWithUdata, } #[derive(Serialize, Deserialize)] pub struct ApiItemsResponse { pub count: usize, pub pages: usize, pub items: NodesWithUdata, } #[derive(Serialize, Deserialize)] pub struct ApiHomeResponse { pub toplevel: NodesWithUdata, pub categories: Vec<(String, NodesWithUdata)>, }