mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-25 10:08:29 +02:00
Better TS type generation
This commit is contained in:
8
package-lock.json
generated
8
package-lock.json
generated
@@ -26,7 +26,7 @@
|
|||||||
"@tauri-apps/plugin-fs": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-fs": "^2.0.0-rc.0",
|
||||||
"@tauri-apps/plugin-os": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-os": "^2.0.0-rc.0",
|
||||||
"@tauri-apps/plugin-shell": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-shell": "^2.0.0-rc.0",
|
||||||
"@yaakapp/api": "^0.1.0-beta.9",
|
"@yaakapp/api": "^0.1.2",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
"cm6-graphql": "^0.0.9",
|
"cm6-graphql": "^0.0.9",
|
||||||
@@ -2981,9 +2981,9 @@
|
|||||||
"integrity": "sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ=="
|
"integrity": "sha512-N8tkAACJx2ww8vFMneJmaAgmjAG1tnVBZJRLRcx061tmsLRZHSEZSLuGWnwPtunsSLvSqXQ2wfp7Mgqg1I+2dQ=="
|
||||||
},
|
},
|
||||||
"node_modules/@yaakapp/api": {
|
"node_modules/@yaakapp/api": {
|
||||||
"version": "0.1.0-beta.9",
|
"version": "0.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.0-beta.9.tgz",
|
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.2.tgz",
|
||||||
"integrity": "sha512-aNh1e2mUOV7GlIiVjDu6GSdvPPH1mz0k3coJs0jP1UhDr2V63RUC/phf00ei4odAO1VGlS7ISrtXCRJ7rK93aQ==",
|
"integrity": "sha512-VEs+H9ZJjp/MFHKbqTdG/eGtvjDZ36P1pmzEYm6VYGIN2Bfw3OyXzkn7vgIg1savX0LU/U5kI88AYXGMr5Fjdw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "^22.0.0"
|
"@types/node": "^22.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
"@tauri-apps/plugin-fs": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-fs": "^2.0.0-rc.0",
|
||||||
"@tauri-apps/plugin-os": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-os": "^2.0.0-rc.0",
|
||||||
"@tauri-apps/plugin-shell": "^2.0.0-rc.0",
|
"@tauri-apps/plugin-shell": "^2.0.0-rc.0",
|
||||||
"@yaakapp/api": "^0.1.0-beta.9",
|
"@yaakapp/api": "^0.1.2",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"classnames": "^2.3.2",
|
"classnames": "^2.3.2",
|
||||||
"cm6-graphql": "^0.0.9",
|
"cm6-graphql": "^0.0.9",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@yaakapp/api",
|
"name": "@yaakapp/api",
|
||||||
"version": "0.1.0-beta.9",
|
"version": "0.1.2",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"typings": "./lib/index.d.ts",
|
"typings": "./lib/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
3
plugin-runtime-types/src/gen/GrpcConnection.ts
Normal file
3
plugin-runtime-types/src/gen/GrpcConnection.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
|
|
||||||
|
export type GrpcConnection = { id: string, model: "grpc_connection", workspaceId: string, requestId: string, createdAt: string, updatedAt: string, service: string, method: string, elapsed: number, status: number, url: string, error: string | null, trailers: { [key: string]: string }, };
|
||||||
4
plugin-runtime-types/src/gen/GrpcEvent.ts
Normal file
4
plugin-runtime-types/src/gen/GrpcEvent.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
|
import type { GrpcEventType } from "./GrpcEventType";
|
||||||
|
|
||||||
|
export type GrpcEvent = { id: string, model: "grpc_event", workspaceId: string, requestId: string, connectionId: string, createdAt: string, content: string, eventType: GrpcEventType, metadata: { [key: string]: string }, status: number | null, error: string | null, };
|
||||||
3
plugin-runtime-types/src/gen/GrpcEventType.ts
Normal file
3
plugin-runtime-types/src/gen/GrpcEventType.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
|
|
||||||
|
export type GrpcEventType = "info" | "error" | "client_message" | "server_message" | "connection_start" | "connection_end";
|
||||||
3
plugin-runtime-types/src/gen/KeyValue.ts
Normal file
3
plugin-runtime-types/src/gen/KeyValue.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
|
|
||||||
|
export type KeyValue = { model: "key_value", createdAt: string, updatedAt: string, namespace: string, key: string, value: string, };
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||||
import type { Environment } from "./Environment";
|
import type { Environment } from "./Environment";
|
||||||
import type { Folder } from "./Folder";
|
import type { Folder } from "./Folder";
|
||||||
|
import type { GrpcConnection } from "./GrpcConnection";
|
||||||
|
import type { GrpcEvent } from "./GrpcEvent";
|
||||||
import type { GrpcRequest } from "./GrpcRequest";
|
import type { GrpcRequest } from "./GrpcRequest";
|
||||||
import type { HttpRequest } from "./HttpRequest";
|
import type { HttpRequest } from "./HttpRequest";
|
||||||
import type { HttpResponse } from "./HttpResponse";
|
import type { HttpResponse } from "./HttpResponse";
|
||||||
|
import type { KeyValue } from "./KeyValue";
|
||||||
import type { Workspace } from "./Workspace";
|
import type { Workspace } from "./Workspace";
|
||||||
|
|
||||||
export type Model = { "workspace": Workspace } | { "environment": Environment } | { "folder": Folder } | { "httpRequest": HttpRequest } | { "httpResponse": HttpResponse } | { "grpcRequest": GrpcRequest };
|
export type Model = Environment | Folder | GrpcConnection | GrpcEvent | GrpcRequest | HttpRequest | HttpResponse | KeyValue | Workspace;
|
||||||
|
|||||||
@@ -1,25 +1,30 @@
|
|||||||
export type * from './plugins';
|
export type * from './plugins';
|
||||||
export type * from './themes';
|
export type * from './themes';
|
||||||
|
|
||||||
|
export * from './gen/BootRequest';
|
||||||
|
export * from './gen/BootResponse';
|
||||||
|
export * from './gen/EmptyResponse';
|
||||||
export * from './gen/Environment';
|
export * from './gen/Environment';
|
||||||
export * from './gen/EnvironmentVariable';
|
export * from './gen/EnvironmentVariable';
|
||||||
|
export * from './gen/ExportHttpRequestRequest';
|
||||||
|
export * from './gen/ExportHttpRequestResponse';
|
||||||
|
export * from './gen/FilterRequest';
|
||||||
|
export * from './gen/FilterResponse';
|
||||||
export * from './gen/Folder';
|
export * from './gen/Folder';
|
||||||
|
export * from './gen/GrpcConnection';
|
||||||
|
export * from './gen/GrpcEvent';
|
||||||
export * from './gen/GrpcMetadataEntry';
|
export * from './gen/GrpcMetadataEntry';
|
||||||
export * from './gen/GrpcRequest';
|
export * from './gen/GrpcRequest';
|
||||||
export * from './gen/HttpRequest';
|
export * from './gen/HttpRequest';
|
||||||
export * from './gen/HttpRequestHeader';
|
export * from './gen/HttpRequestHeader';
|
||||||
export * from './gen/HttpResponse';
|
export * from './gen/HttpResponse';
|
||||||
|
export * from './gen/HttpResponseHeader';
|
||||||
export * from './gen/HttpUrlParameter';
|
export * from './gen/HttpUrlParameter';
|
||||||
export * from './gen/BootRequest';
|
|
||||||
export * from './gen/BootResponse';
|
|
||||||
export * from './gen/EmptyResponse';
|
|
||||||
export * from './gen/ExportHttpRequestRequest';
|
|
||||||
export * from './gen/ExportHttpRequestResponse';
|
|
||||||
export * from './gen/FilterRequest';
|
|
||||||
export * from './gen/FilterResponse';
|
|
||||||
export * from './gen/ImportRequest';
|
export * from './gen/ImportRequest';
|
||||||
export * from './gen/InternalEvent';
|
|
||||||
export * from './gen/InternalEventPayload';
|
|
||||||
export * from './gen/ImportResources';
|
export * from './gen/ImportResources';
|
||||||
export * from './gen/ImportResponse';
|
export * from './gen/ImportResponse';
|
||||||
|
export * from './gen/InternalEvent';
|
||||||
|
export * from './gen/InternalEventPayload';
|
||||||
|
export * from './gen/KeyValue';
|
||||||
|
export * from './gen/Model';
|
||||||
export * from './gen/Workspace';
|
export * from './gen/Workspace';
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ use ts_rs::TS;
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct Settings {
|
pub struct Settings {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
#[ts(type = "\"settings\"")]
|
#[ts(type = "\"settings\"")]
|
||||||
@@ -72,7 +71,6 @@ impl<'s> TryFrom<&Row<'s>> for Settings {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct Workspace {
|
pub struct Workspace {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
#[ts(type = "\"workspace\"")]
|
#[ts(type = "\"workspace\"")]
|
||||||
@@ -140,7 +138,6 @@ impl Workspace {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||||
#[ts(export)]
|
|
||||||
enum CookieDomain {
|
enum CookieDomain {
|
||||||
HostOnly(String),
|
HostOnly(String),
|
||||||
Suffix(String),
|
Suffix(String),
|
||||||
@@ -149,14 +146,12 @@ enum CookieDomain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||||
#[ts(export)]
|
|
||||||
enum CookieExpires {
|
enum CookieExpires {
|
||||||
AtUtc(String),
|
AtUtc(String),
|
||||||
SessionEnd,
|
SessionEnd,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||||
#[ts(export)]
|
|
||||||
pub struct Cookie {
|
pub struct Cookie {
|
||||||
raw_cookie: String,
|
raw_cookie: String,
|
||||||
domain: CookieDomain,
|
domain: CookieDomain,
|
||||||
@@ -166,7 +161,6 @@ pub struct Cookie {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct CookieJar {
|
pub struct CookieJar {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
#[ts(type = "\"cookie_jar\"")]
|
#[ts(type = "\"cookie_jar\"")]
|
||||||
@@ -210,7 +204,6 @@ impl<'s> TryFrom<&Row<'s>> for CookieJar {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct Environment {
|
pub struct Environment {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
pub workspace_id: String,
|
pub workspace_id: String,
|
||||||
@@ -254,7 +247,6 @@ impl<'s> TryFrom<&Row<'s>> for Environment {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct EnvironmentVariable {
|
pub struct EnvironmentVariable {
|
||||||
#[serde(default = "default_true")]
|
#[serde(default = "default_true")]
|
||||||
#[ts(optional, as = "Option<bool>")]
|
#[ts(optional, as = "Option<bool>")]
|
||||||
@@ -265,7 +257,6 @@ pub struct EnvironmentVariable {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct Folder {
|
pub struct Folder {
|
||||||
pub created_at: NaiveDateTime,
|
pub created_at: NaiveDateTime,
|
||||||
pub updated_at: NaiveDateTime,
|
pub updated_at: NaiveDateTime,
|
||||||
@@ -311,7 +302,6 @@ impl<'s> TryFrom<&Row<'s>> for Folder {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct HttpRequestHeader {
|
pub struct HttpRequestHeader {
|
||||||
#[serde(default = "default_true")]
|
#[serde(default = "default_true")]
|
||||||
#[ts(optional, as = "Option<bool>")]
|
#[ts(optional, as = "Option<bool>")]
|
||||||
@@ -322,7 +312,6 @@ pub struct HttpRequestHeader {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct HttpUrlParameter {
|
pub struct HttpUrlParameter {
|
||||||
#[serde(default = "default_true")]
|
#[serde(default = "default_true")]
|
||||||
#[ts(optional, as = "Option<bool>")]
|
#[ts(optional, as = "Option<bool>")]
|
||||||
@@ -333,7 +322,6 @@ pub struct HttpUrlParameter {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct HttpRequest {
|
pub struct HttpRequest {
|
||||||
pub created_at: NaiveDateTime,
|
pub created_at: NaiveDateTime,
|
||||||
pub updated_at: NaiveDateTime,
|
pub updated_at: NaiveDateTime,
|
||||||
@@ -410,7 +398,6 @@ impl<'s> TryFrom<&Row<'s>> for HttpRequest {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct HttpResponseHeader {
|
pub struct HttpResponseHeader {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub value: String,
|
pub value: String,
|
||||||
@@ -418,7 +405,6 @@ pub struct HttpResponseHeader {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct HttpResponse {
|
pub struct HttpResponse {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
#[ts(type = "\"http_response\"")]
|
#[ts(type = "\"http_response\"")]
|
||||||
@@ -501,7 +487,6 @@ impl HttpResponse {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct GrpcMetadataEntry {
|
pub struct GrpcMetadataEntry {
|
||||||
#[serde(default = "default_true")]
|
#[serde(default = "default_true")]
|
||||||
#[ts(optional, as = "Option<bool>")]
|
#[ts(optional, as = "Option<bool>")]
|
||||||
@@ -512,7 +497,6 @@ pub struct GrpcMetadataEntry {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct GrpcRequest {
|
pub struct GrpcRequest {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
#[ts(type = "\"grpc_request\"")]
|
#[ts(type = "\"grpc_request\"")]
|
||||||
@@ -582,7 +566,6 @@ impl<'s> TryFrom<&Row<'s>> for GrpcRequest {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct GrpcConnection {
|
pub struct GrpcConnection {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
#[ts(type = "\"grpc_connection\"")]
|
#[ts(type = "\"grpc_connection\"")]
|
||||||
@@ -644,7 +627,6 @@ impl<'s> TryFrom<&Row<'s>> for GrpcConnection {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq, TS)]
|
||||||
#[serde(rename_all = "snake_case")]
|
#[serde(rename_all = "snake_case")]
|
||||||
#[ts(export)]
|
|
||||||
pub enum GrpcEventType {
|
pub enum GrpcEventType {
|
||||||
Info,
|
Info,
|
||||||
Error,
|
Error,
|
||||||
@@ -662,7 +644,6 @@ impl Default for GrpcEventType {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct GrpcEvent {
|
pub struct GrpcEvent {
|
||||||
pub id: String,
|
pub id: String,
|
||||||
#[ts(type = "\"grpc_event\"")]
|
#[ts(type = "\"grpc_event\"")]
|
||||||
@@ -720,7 +701,6 @@ impl<'s> TryFrom<&Row<'s>> for GrpcEvent {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, Default, TS)]
|
||||||
#[serde(default, rename_all = "camelCase")]
|
#[serde(default, rename_all = "camelCase")]
|
||||||
#[ts(export)]
|
|
||||||
pub struct KeyValue {
|
pub struct KeyValue {
|
||||||
#[ts(type = "\"key_value\"")]
|
#[ts(type = "\"key_value\"")]
|
||||||
pub model: String,
|
pub model: String,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use ts_rs::TS;
|
use ts_rs::TS;
|
||||||
|
|
||||||
use yaak_models::models::{Environment, Folder, GrpcRequest, HttpRequest, HttpResponse, Workspace};
|
use yaak_models::models::{Environment, Folder, GrpcConnection, GrpcEvent, GrpcRequest, HttpRequest, HttpResponse, KeyValue, Workspace};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
@@ -120,13 +120,16 @@ pub struct ImportResources {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
#[derive(Debug, Clone, Serialize, Deserialize, TS)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase", untagged)]
|
||||||
#[ts(export)]
|
#[ts(export)]
|
||||||
pub enum Model {
|
pub enum Model {
|
||||||
Workspace(Workspace),
|
|
||||||
Environment(Environment),
|
Environment(Environment),
|
||||||
Folder(Folder),
|
Folder(Folder),
|
||||||
|
GrpcConnection(GrpcConnection),
|
||||||
|
GrpcEvent(GrpcEvent),
|
||||||
|
GrpcRequest(GrpcRequest),
|
||||||
HttpRequest(HttpRequest),
|
HttpRequest(HttpRequest),
|
||||||
HttpResponse(HttpResponse),
|
HttpResponse(HttpResponse),
|
||||||
GrpcRequest(GrpcRequest),
|
KeyValue(KeyValue),
|
||||||
|
Workspace(Workspace),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,4 @@
|
|||||||
import type {
|
import type { GrpcConnection, HttpResponse, HttpResponseHeader, Model } from '@yaakapp/api';
|
||||||
Environment,
|
|
||||||
Folder,
|
|
||||||
GrpcConnection,
|
|
||||||
GrpcEvent,
|
|
||||||
GrpcRequest,
|
|
||||||
HttpRequest,
|
|
||||||
HttpResponse,
|
|
||||||
KeyValue,
|
|
||||||
Workspace,
|
|
||||||
HttpResponseHeader,
|
|
||||||
} from '@yaakapp/api';
|
|
||||||
import type { Cookie } from './models/Cookie';
|
import type { Cookie } from './models/Cookie';
|
||||||
import type { CookieJar } from './models/CookieJar';
|
import type { CookieJar } from './models/CookieJar';
|
||||||
import type { Settings } from './models/Settings';
|
import type { Settings } from './models/Settings';
|
||||||
@@ -29,19 +18,6 @@ export const AUTH_TYPE_NONE = null;
|
|||||||
export const AUTH_TYPE_BASIC = 'basic';
|
export const AUTH_TYPE_BASIC = 'basic';
|
||||||
export const AUTH_TYPE_BEARER = 'bearer';
|
export const AUTH_TYPE_BEARER = 'bearer';
|
||||||
|
|
||||||
export type Model =
|
|
||||||
| Settings
|
|
||||||
| Workspace
|
|
||||||
| Folder
|
|
||||||
| GrpcConnection
|
|
||||||
| GrpcRequest
|
|
||||||
| GrpcEvent
|
|
||||||
| HttpRequest
|
|
||||||
| HttpResponse
|
|
||||||
| KeyValue
|
|
||||||
| Environment
|
|
||||||
| CookieJar;
|
|
||||||
|
|
||||||
export function cookieDomain(cookie: Cookie): string {
|
export function cookieDomain(cookie: Cookie): string {
|
||||||
if (cookie.domain === 'NotPresent' || cookie.domain === 'Empty') {
|
if (cookie.domain === 'NotPresent' || cookie.domain === 'Empty') {
|
||||||
return 'n/a';
|
return 'n/a';
|
||||||
|
|||||||
Reference in New Issue
Block a user