request-typer
Advanced tools
Comparing version 1.2.2 to 1.2.3
import { RequestParameter } from "./parameter"; | ||
import { AllSchema } from "./schema"; | ||
import { AllSchema, Resolve } from "./schema"; | ||
export declare type Method = "get" | "post" | "put" | "patch" | "delete"; | ||
@@ -17,2 +17,17 @@ export declare type Parameters = { | ||
}; | ||
export declare type ResolveQueryParameters<T extends Parameters> = { | ||
[key in keyof T]: T[key] extends { | ||
type: "query"; | ||
} ? Resolve<T[key]["schema"]> : never; | ||
}; | ||
export declare type ResolvePathParameters<T extends Parameters> = { | ||
[key in keyof T]: T[key] extends { | ||
type: "path"; | ||
} ? Resolve<T[key]["schema"]> : never; | ||
}; | ||
export declare type ResolveRequestBody<T extends Parameters> = { | ||
[key in keyof T]: T[key] extends { | ||
type: "body"; | ||
} ? Resolve<T[key]["schema"]> : never; | ||
}; | ||
export declare class HTTP { | ||
@@ -19,0 +34,0 @@ static GET<P extends Parameters, R extends ResponseBody>(operationId: string, path: string, parameters: P, response: R): HTTPRequest<"get", P, R>; |
{ | ||
"name": "request-typer", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "Make typed request schema and build OpenAPI Specification", | ||
@@ -5,0 +5,0 @@ "files": [ |
55313
1075