export api types to ts (#2583)

This commit is contained in:
Aiden McClelland
2024-04-01 13:14:22 -06:00
committed by GitHub
parent 8884f64b4e
commit f021ad9b0a
94 changed files with 629 additions and 179 deletions

View File

@@ -9,6 +9,7 @@ use indicatif::{ProgressBar, ProgressStyle};
use reqwest::{header, Body, Client, Url};
use rpc_toolkit::command;
use serde::{Deserialize, Serialize};
use ts_rs::TS;
use crate::context::CliContext;
use crate::s9pk::S9pk;

View File

@@ -5,6 +5,7 @@ use reqwest::{StatusCode, Url};
use rpc_toolkit::{command, from_fn_async, HandlerExt, ParentHandler};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use ts_rs::TS;
use crate::context::{CliContext, RpcContext};
use crate::version::VersionT;
@@ -36,10 +37,12 @@ pub fn with_query_params(ctx: RpcContext, mut url: Url) -> Url {
url
}
#[derive(Deserialize, Serialize, Parser)]
#[derive(Deserialize, Serialize, Parser, TS)]
#[serde(rename_all = "camelCase")]
#[command(rename_all = "kebab-case")]
#[ts(export)]
pub struct GetParams {
#[ts(type = "string")]
url: Url,
}