diff options
Diffstat (limited to '_www/interface.ts')
| -rw-r--r-- | _www/interface.ts | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/_www/interface.ts b/_www/interface.ts index 55ce91d..503480d 100644 --- a/_www/interface.ts +++ b/_www/interface.ts @@ -1,150 +1,150 @@ // SPDX-FileCopyrightText: 2021 M. Shulhan <ms@kilabit.info> // SPDX-License-Identifier: GPL-3.0-or-later -export const CLASS_INPUT_LABEL = "trunks_input_label" -export const CLASS_INPUT = "trunks_input" -export const CLASS_NAV_LINK = "nav_link" -export const CLASS_NAV_TARGET = "nav_target" +export const CLASS_INPUT_LABEL = "trunks_input_label"; +export const CLASS_INPUT = "trunks_input"; +export const CLASS_NAV_LINK = "nav_link"; +export const CLASS_NAV_TARGET = "nav_target"; -export const HASH_ENVIRONMENT = "environment" -export const HASH_LINKS = "links" +export const HASH_ENVIRONMENT = "environment"; +export const HASH_LINKS = "links"; -export const FormInputKindNumber = "number" -export const FormInputKindString = "string" +export const FormInputKindNumber = "number"; +export const FormInputKindString = "string"; export interface AttackOptionsInterface { - Duration: number - RatePerSecond: number - Timeout: number + Duration: number; + RatePerSecond: number; + Timeout: number; } export interface AttackResult { - TargetID: string - HttpTargetID: string - Name: string - TextReport: string - HistReport: string + TargetID: string; + HttpTargetID: string; + Name: string; + TextReport: string; + HistReport: string; } export interface EnvironmentInterface { - ListenAddress: string - MaxAttackDuration: number - MaxAttackRate: number - ResultsDir: string - ResultsSuffix: string - AttackRunning: RunRequestInterface | null + ListenAddress: string; + MaxAttackDuration: number; + MaxAttackRate: number; + ResultsDir: string; + ResultsSuffix: string; + AttackRunning: RunRequestInterface | null; } export interface FormInput { - label: string - hint: string - kind: string - value: string - max?: number - min?: number + label: string; + hint: string; + kind: string; + value: string; + max?: number; + min?: number; } export interface HttpResponseInterface { - code: number - message: string - data?: any + code: number; + message: string; + data?: any; } export interface HttpTargetInterface { - Name: string - Hint?: string - ID: string - Method: number - Path: string - RequestType: number - Headers: KeyFormInput - Params: KeyFormInput - Results: AttackResult[] - AllowAttack: boolean - IsCustomizable: boolean + Name: string; + Hint?: string; + ID: string; + Method: number; + Path: string; + RequestType: number; + Headers: KeyFormInput; + Params: KeyFormInput; + Results: AttackResult[]; + AllowAttack: boolean; + IsCustomizable: boolean; } export interface KeyFormInput { - [key: string]: FormInput + [key: string]: FormInput; } export interface MapIdTarget { - [key: string]: TargetInterface + [key: string]: TargetInterface; } export interface MapNumberString { - [key: number]: string + [key: number]: string; } export interface NavLinkInterface { - ID: string - Text: string - Href: string - OpenInIFrame: boolean + ID: string; + Text: string; + Href: string; + OpenInIFrame: boolean; } export interface RunRequestInterface { - Target: TargetInterface - HttpTarget: HttpTargetInterface | null - WebSocketTarget: WebSocketTargetInterface | null - Result?: AttackResult | null + Target: TargetInterface; + HttpTarget: HttpTargetInterface | null; + WebSocketTarget: WebSocketTargetInterface | null; + Result?: AttackResult | null; } export interface RunResponseInterface { - DumpRequest: string - DumpResponse: string - ResponseStatus: string - ResponseStatusCode: number - ResponseType: string - ResponseBody: string + DumpRequest: string; + DumpResponse: string; + ResponseStatus: string; + ResponseStatusCode: number; + ResponseType: string; + ResponseBody: string; } export interface TargetInterface { - ID: string - Name: string - Hint?: string - BaseUrl: string - Opts: AttackOptionsInterface - Vars: KeyFormInput - HttpTargets: HttpTargetInterface[] - WebSocketTargets: WebSocketTargetInterface[] + ID: string; + Name: string; + Hint?: string; + BaseUrl: string; + Opts: AttackOptionsInterface; + Vars: KeyFormInput; + HttpTargets: HttpTargetInterface[]; + WebSocketTargets: WebSocketTargetInterface[]; } export interface TrunksInterface { - AttackHttp( - target: TargetInterface, - http_target: HttpTargetInterface, - ): Promise<HttpResponseInterface | null> + AttackHttp( + target: TargetInterface, + http_target: HttpTargetInterface, + ): Promise<HttpResponseInterface | null>; - AttackHttpDelete(name: string): Promise<HttpResponseInterface | null> + AttackHttpDelete(name: string): Promise<HttpResponseInterface | null>; - AttackHttpGet(name: string): Promise<HttpResponseInterface> + AttackHttpGet(name: string): Promise<HttpResponseInterface>; - ContentRenderer( - target: TargetInterface, - http_target: HttpTargetInterface | null, - ws_target: WebSocketTargetInterface | null, - nav_link: NavLinkInterface | null, - el: HTMLElement, - ): void + ContentRenderer( + target: TargetInterface, + http_target: HttpTargetInterface | null, + ws_target: WebSocketTargetInterface | null, + nav_link: NavLinkInterface | null, + el: HTMLElement, + ): void; - SetContent(path: string, el: HTMLElement | null): void + SetContent(path: string, el: HTMLElement | null): void; - RunHttp( - target: TargetInterface, - http_target: HttpTargetInterface, - ): Promise<RunResponseInterface | null> + RunHttp( + target: TargetInterface, + http_target: HttpTargetInterface, + ): Promise<RunResponseInterface | null>; - RunWebSocket( - target: TargetInterface, - WebSocketTargetInterface: WebSocketTargetInterface, - ): Promise<HttpResponseInterface | null> + RunWebSocket( + target: TargetInterface, + WebSocketTargetInterface: WebSocketTargetInterface, + ): Promise<HttpResponseInterface | null>; } export interface WebSocketTargetInterface { - ID: string - Name: string - Hint?: string - Headers: KeyFormInput - Params: KeyFormInput + ID: string; + Name: string; + Hint?: string; + Headers: KeyFormInput; + Params: KeyFormInput; } |
