/* 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) 2026 metamuffin */ use jellyobject::{Object, Tag, enums, fields}; fields! { QUERY_PARENT: u64 = 2000 "parent"; QUERY_SEARCH: &str = 2001 "search"; QUERY_KIND: Tag = 2004 "kind"; // multi QUERY_SORT: Tag = 2002 "sort"; // one of RTYP_*, NU_RATING, NO_DURATION, NO_NAME QUERY_SORT_ASCENDING: () = 2003 "sort_ascending"; VIEW_TITLE: &str = 2005 "title"; VIEW_MESSAGE: Object = 2010 "message"; VIEW_NODE_PAGE: Object = 2011 "node_page"; VIEW_NODE_LIST: Object = 2012 "node_list"; // multi VIEW_PLAYER: u64 = 2028 "player"; VIEW_STATGROUP: Object = 2041 "statgroup"; VIEW_STATTEXT: Object = 2042 "stattext"; VIEW_ACCOUNT_LOGIN: () = 2043 "account_login"; VIEW_ACCOUNT_LOGOUT: () = 2044 "account_logout"; VIEW_ACCOUNT_SET_PASSWORD: &str = 2045 "account_set_password"; VIEW_ADMIN_DASHBOARD: () = 2046 "admin_dashboard"; VIEW_ADMIN_IMPORT: Object = 2047 "admin_import"; ADMIN_IMPORT_BUSY: () = 2048 "busy"; ADMIN_IMPORT_ERROR: &str = 2049 "error"; // multi NKU_NODE: Object = 2025 "node"; NKU_UDATA: Object = 2026 "udata"; NKU_ROLE: &str = 2027 "role"; NODELIST_TITLE: &str = 2007 "title"; NODELIST_DISPLAYSTYLE: &str = 2008 "displaystyle"; NODELIST_ITEM: &str = 2009 "item"; MESSAGE_KIND: &str = 2029 "kind"; MESSAGE_TEXT: &str = 2030 "text"; STATGROUP_TITLE: &str = 2039 "title"; STATGROUP_BIN: Object = 2040 "bin"; STAT_NAME: &str = 2038 "name"; STAT_COUNT: u64 = 2031 "count"; STAT_TOTAL_SIZE: u64 = 2032 "total_size"; STAT_TOTAL_DURATION: f64 = 2033 "total_duration"; STAT_MAX_SIZE: u64 = 2036 "max_size"; STAT_MAX_DURATION: f64 = 2037 "max_duration"; } enums! { NLSTYLE_GRID = 1023 "grid"; NLSTYLE_INLINE = 1024 "inline"; NLSTYLE_LIST = 1025 "list"; } // use crate::user::{NodeUserData, User}; // use std::{collections::BTreeMap, sync::Arc, time::Duration}; // pub struct ApiNodeResponse { // pub parents: NodesWithUdata, // pub children: NodesWithUdata, // pub node: Arc, // pub userdata: NodeUserData, // } // pub struct ApiSearchResponse { // pub count: usize, // pub results: NodesWithUdata, // pub duration: Duration, // } // pub struct ApiItemsResponse { // pub count: usize, // pub pages: usize, // pub items: NodesWithUdata, // } // pub struct ApiHomeResponse { // pub toplevel: NodesWithUdata, // pub categories: Vec<(String, NodesWithUdata)>, // } // pub struct ApiStatsResponse { // pub kinds: BTreeMap, // pub total: StatsBin, // } // pub struct ApiAdminUsersResponse { // pub users: Vec, // } // #[derive(Default, Serialize, Deserialize)] // pub struct StatsBin { // pub runtime: f64, // pub size: u64, // pub count: usize, // pub max_runtime: f64, // pub max_runtime_node: String, // pub max_size: u64, // pub max_size_node: String, // }