Skip to content

Commit

Permalink
fix: typescript types
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitFicus committed Feb 27, 2024
1 parent 60eeb54 commit 4ae8d63
Showing 1 changed file with 35 additions and 40 deletions.
75 changes: 35 additions & 40 deletions server/templates/otoroshi/ts/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export interface Apikey {
clientId: string;
clientName: string;
metadata: Map<string, string>;
tags: [String];
tags: string[];
}

export interface User {
name: string;
email: string;
profile: any;
metadata: Map<string, string>;
tags: [string];
tags: string[];
}

export interface RawRequest {
Expand All @@ -40,12 +40,12 @@ export interface RawRequest {
}

export interface Frontend {
domains: [string];
domains: string[];
strict_path?: string;
exact: boolean;
headers: Map<string, string>;
query: Map<string, string>;
methods: [string];
methods: string[];
}

export interface HealthCheck {
Expand All @@ -54,7 +54,7 @@ export interface HealthCheck {
}

export interface RouteBackend {
targets: [Backend];
targets: Backend[];
root: string;
rewrite: boolean;
load_balancing: any;
Expand All @@ -66,15 +66,15 @@ export interface Route {
id: string;
name: string;
description: string;
tags: [string];
tags: string[];
metadata: Map<string, string>;
enabled: boolean;
debug_flow: boolean;
export_reporting: boolean;
capture: boolean;
groups: [string];
frontend: Frontend,
backend: RouteBackend,
groups: string[];
frontend: Frontend;
backend: RouteBackend;
backend_ref?: string;
plugins: any;
}
Expand All @@ -91,71 +91,66 @@ export interface OtoroshiRequest {
headers: Map<string, string>;
version: string;
client_cert_chain: any;
backend?: [Backend];
backend?: Backend;
cookies: any;
}


export interface WasmQueryContext {
snowflake?: string;
backend: Backend;
apikey?: [Apikey];
user?: [User];
raw_request: RawRequest,
apikey?: Apikey;
user?: User;
raw_request: RawRequest;
config: any;
global_config: any;
attrs: any;
route: Route,
raw_request_body?: string;
request: OtoroshiRequest,
route: Route;
request_body_bytes?: number[];
request: OtoroshiRequest;
}


export interface WasmAccessValidatorContext {
snowflake?: string;
apikey?: [Apikey];
user?: [User];
request: RawRequest,
apikey?: Apikey;
user?: User;
request: RawRequest;
config: any;
global_config: any;
attrs: any;
route: Route,
route: Route;
}


export interface WasmRequestTransformerContext {
snowflake?: string;
raw_request: OtoroshiRequest,
otoroshi_request: OtoroshiRequest,
backend: Backend,
apikey?: [Apikey];
user?: [User];
request: RawRequest,
raw_request: OtoroshiRequest;
otoroshi_request: OtoroshiRequest;
backend: Backend;
apikey?: Apikey;
user?: User;
request: RawRequest;
config: any;
global_config: any;
attrs: any;
route: Route,
route: Route;
}


export interface WasmResponseTransformerContext {
snowflake?: string;
raw_response: OtoroshiResponse,
otoroshi_response: OtoroshiResponse,
apikey?: [Apikey];
user?: [User];
request: RawRequest,
raw_response: OtoroshiResponse;
otoroshi_response: OtoroshiResponse;
apikey?: Apikey;
user?: User;
request: RawRequest;
config: any;
global_config: any;
attrs: any;
route: Route,
route: Route;
body?: string;
}


export interface WasmSinkContext {
snowflake?: string;
request: RawRequest,
request: RawRequest;
config: any;
global_config: any;
attrs: any;
Expand Down Expand Up @@ -199,4 +194,4 @@ export interface WasmSinkHandleResponse {
headers: Map<string, string>;
body?: string;
bodyBase64?: string;
}
}

0 comments on commit 4ae8d63

Please sign in to comment.