17 lines
527 B
TypeScript
17 lines
527 B
TypeScript
import { RequestId } from "common";
|
|
import { Context, Effect, Option as O } from "effect";
|
|
|
|
export interface RequestInterface {
|
|
readonly requestId: RequestId;
|
|
readonly method: string;
|
|
readonly pathname: string;
|
|
readonly path: readonly string[];
|
|
readonly query: { readonly [_: string]: string };
|
|
readonly headers: { readonly [_: string]: string };
|
|
readonly ip: O.Option<string>;
|
|
|
|
readonly json: Effect.Effect<unknown, SyntaxError>;
|
|
}
|
|
|
|
export class Request extends Context.Tag("Request")<Request, RequestInterface>() { }
|