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

@@ -15,6 +15,9 @@ use josekit::jwk::Jwk;
use serde::{Deserialize, Serialize};
use sha2::Sha256;
use tracing::instrument;
use ts_rs::TS;
use crate::prelude::*;
pub fn pbkdf2(password: impl AsRef<[u8]>, salt: impl AsRef<[u8]>) -> CipherKey<Aes256Ctr> {
let mut aeskey = CipherKey::<Aes256Ctr>::default();
@@ -53,9 +56,11 @@ pub fn decrypt_slice(input: impl AsRef<[u8]>, password: impl AsRef<[u8]>) -> Vec
res
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[derive(Debug, Clone, Deserialize, Serialize, TS)]
#[ts(export)]
pub struct EncryptedWire {
encrypted: serde_json::Value,
#[ts(type = "any")]
encrypted: Value,
}
impl EncryptedWire {
#[instrument(skip_all)]

View File

@@ -580,7 +580,7 @@ where
}
}
#[derive(Deserialize, Serialize)]
#[derive(Deserialize, Serialize, TS)]
pub struct StdinDeserializable<T>(pub T);
impl<T> FromArgMatches for StdinDeserializable<T>
where