-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f32ecb6
commit 39fed00
Showing
5 changed files
with
128 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,58 @@ | ||
export type EchoResponse = { | ||
uuid: string | ||
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS' | ||
id: string | ||
method: HTTPMethod | ||
url: string | ||
protocol: string | ||
pathname: string | ||
origin: string | ||
hostname: string | ||
searchParams: Record<string, string> | ||
headers: Record<string, string> | ||
port: string | ||
pathname: string | ||
search: string | ||
searchParams: EchoResponseKeyValRecord | ||
headers: EchoResponseKeyValRecord | ||
body: any | ||
formData?: Record<string, string> | ||
formData: EchoResponseKeyValRecord | null | ||
binaryFiles: EchoResponseFileInfo[] | ||
_meta: EchoResponseMeta | ||
} | ||
|
||
export type EchoResponseKeyValRecord = Record<string, string | string[]> | ||
|
||
export type EchoResponseFileInfo = { | ||
uuid: string | ||
id: string | ||
name: string | ||
type: string | ||
size: number | ||
dataURL: string | ||
base64: string | ||
sha256: string | ||
} | ||
|
||
export interface EchoResponseMeta { | ||
starttime: number | ||
endtime: number | ||
duration: number | ||
bodyType: EchoResponseMetaBodyType | ||
FORM_DATA_FLAG: string | ||
BINARY_FILES_FLAG: string | ||
[key: string]: any | ||
} | ||
|
||
export enum EchoResponseMetaBodyType { | ||
NOT_ACCEPTABLE = 'NOT_ACCEPTABLE', | ||
JSON = 'JSON', | ||
TEXT = 'TEXT', | ||
FORM = 'FORM', | ||
BINARY = 'BINARY', | ||
EMPTY = 'EMPTY', | ||
UNKNOWN = 'UNKNOWN', | ||
} | ||
|
||
export type HTTPMethod = | ||
| 'GET' | ||
| 'POST' | ||
| 'PUT' | ||
| 'DELETE' | ||
| 'PATCH' | ||
| 'HEAD' | ||
| 'OPTIONS' | ||
| 'CONNECT' | ||
| 'TRACE' |