These are the schema definitions for the new JSON-RPC APIs associated with accounts. These are not wired up to business logic yet and will currently throw an internal error indicating these are unimplemented.
36 lines
726 B
Rust
36 lines
726 B
Rust
use schemars::JsonSchema;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
use ts_rs::TS;
|
|
|
|
#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Eq, JsonSchema, TS, Default)]
|
|
#[serde(rename_all = "lowercase")]
|
|
#[ts(rename_all = "lowercase")]
|
|
pub enum PlanType {
|
|
#[default]
|
|
Free,
|
|
Plus,
|
|
Pro,
|
|
Team,
|
|
Business,
|
|
Enterprise,
|
|
Edu,
|
|
#[serde(other)]
|
|
Unknown,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema, TS)]
|
|
#[serde(tag = "type")]
|
|
#[ts(tag = "type")]
|
|
pub enum Account {
|
|
ApiKey {
|
|
api_key: String,
|
|
},
|
|
#[serde(rename = "chatgpt")]
|
|
#[ts(rename = "chatgpt")]
|
|
ChatGpt {
|
|
email: Option<String>,
|
|
plan_type: PlanType,
|
|
},
|
|
}
|