All generated TS models in two files

This commit is contained in:
Gregory Schier
2024-09-19 13:22:56 -07:00
parent 3ee9ed8bf4
commit 53b8463223
73 changed files with 256 additions and 361 deletions

View File

@@ -8,6 +8,7 @@ use ts_rs::TS;
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct Settings {
pub id: String,
#[ts(type = "\"settings\"")]
@@ -74,6 +75,7 @@ impl<'s> TryFrom<&Row<'s>> for Settings {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct Workspace {
pub id: String,
#[ts(type = "\"workspace\"")]
@@ -141,6 +143,7 @@ impl Workspace {
}
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[ts(export, export_to="models.ts")]
enum CookieDomain {
HostOnly(String),
Suffix(String),
@@ -149,12 +152,14 @@ enum CookieDomain {
}
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[ts(export, export_to="models.ts")]
enum CookieExpires {
AtUtc(String),
SessionEnd,
}
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
#[ts(export, export_to="models.ts")]
pub struct Cookie {
raw_cookie: String,
domain: CookieDomain,
@@ -164,6 +169,7 @@ pub struct Cookie {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct CookieJar {
pub id: String,
#[ts(type = "\"cookie_jar\"")]
@@ -207,6 +213,7 @@ impl<'s> TryFrom<&Row<'s>> for CookieJar {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct Environment {
pub id: String,
pub workspace_id: String,
@@ -250,6 +257,7 @@ impl<'s> TryFrom<&Row<'s>> for Environment {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct EnvironmentVariable {
#[serde(default = "default_true")]
#[ts(optional, as = "Option<bool>")]
@@ -260,6 +268,7 @@ pub struct EnvironmentVariable {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct Folder {
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
@@ -305,6 +314,7 @@ impl<'s> TryFrom<&Row<'s>> for Folder {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct HttpRequestHeader {
#[serde(default = "default_true")]
#[ts(optional, as = "Option<bool>")]
@@ -315,6 +325,7 @@ pub struct HttpRequestHeader {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct HttpUrlParameter {
#[serde(default = "default_true")]
#[ts(optional, as = "Option<bool>")]
@@ -325,6 +336,7 @@ pub struct HttpUrlParameter {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct HttpRequest {
pub created_at: NaiveDateTime,
pub updated_at: NaiveDateTime,
@@ -401,6 +413,7 @@ impl<'s> TryFrom<&Row<'s>> for HttpRequest {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct HttpResponseHeader {
pub name: String,
pub value: String,
@@ -408,6 +421,7 @@ pub struct HttpResponseHeader {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct HttpResponse {
pub id: String,
#[ts(type = "\"http_response\"")]
@@ -490,6 +504,7 @@ impl HttpResponse {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct GrpcMetadataEntry {
#[serde(default = "default_true")]
#[ts(optional, as = "Option<bool>")]
@@ -500,6 +515,7 @@ pub struct GrpcMetadataEntry {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct GrpcRequest {
pub id: String,
#[ts(type = "\"grpc_request\"")]
@@ -569,6 +585,7 @@ impl<'s> TryFrom<&Row<'s>> for GrpcRequest {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct GrpcConnection {
pub id: String,
#[ts(type = "\"grpc_connection\"")]
@@ -630,6 +647,7 @@ impl<'s> TryFrom<&Row<'s>> for GrpcConnection {
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export, export_to="models.ts")]
pub enum GrpcEventType {
Info,
Error,
@@ -647,6 +665,7 @@ impl Default for GrpcEventType {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct GrpcEvent {
pub id: String,
#[ts(type = "\"grpc_event\"")]
@@ -706,6 +725,7 @@ impl<'s> TryFrom<&Row<'s>> for GrpcEvent {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct Plugin {
pub id: String,
#[ts(type = "\"plugin\"")]
@@ -751,6 +771,7 @@ impl<'s> TryFrom<&Row<'s>> for Plugin {
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
#[serde(default, rename_all = "camelCase")]
#[ts(export, export_to="models.ts")]
pub struct KeyValue {
#[ts(type = "\"key_value\"")]
pub model: String,