-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved kras request typing and implementation
- Loading branch information
1 parent
5e427bd
commit 4acd6e0
Showing
11 changed files
with
79 additions
and
23 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
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
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,20 +1,56 @@ | ||
import { IncomingHttpHeaders } from 'http'; | ||
import type FormData from 'form-data'; | ||
import type { IncomingHttpHeaders } from 'http'; | ||
|
||
export interface KrasRequestQuery { | ||
[key: string]: string | Array<string>; | ||
} | ||
|
||
export interface BasicKrasRequest { | ||
/** | ||
* The URL used for the request. | ||
*/ | ||
url: string; | ||
/** | ||
* The target path of the request. | ||
*/ | ||
target: string; | ||
/** | ||
* The query parameters of the request. | ||
*/ | ||
query: KrasRequestQuery; | ||
/** | ||
* The method to trigger the request. | ||
*/ | ||
method: string; | ||
/** | ||
* The headers used for the request. | ||
*/ | ||
headers: IncomingHttpHeaders; | ||
content: string; | ||
/** | ||
* The content of the request. | ||
*/ | ||
content: string | FormData; | ||
/** | ||
* The raw content of the request. | ||
*/ | ||
rawContent: any; | ||
/** | ||
* The form data, in case a form was given. | ||
*/ | ||
formData?: FormData; | ||
} | ||
|
||
export interface KrasRequest extends BasicKrasRequest { | ||
/** | ||
* Indicates if the request has been encrypted. | ||
*/ | ||
encrypted: boolean; | ||
/** | ||
* The remote address triggering the request. | ||
*/ | ||
remoteAddress: string; | ||
/** | ||
* The port used for the request. | ||
*/ | ||
port: string; | ||
} |