feat: init codegen state

This commit is contained in:
liyasthomas
2021-07-18 10:03:52 +05:30
parent 590c21209c
commit 6ebfb1f109
12 changed files with 405 additions and 176 deletions

View File

@@ -21,6 +21,15 @@ export interface HoppRESTRequest {
headers: HoppRESTHeader[]
}
export function makeRESTRequest(
x: Omit<HoppRESTRequest, "v">
): HoppRESTRequest {
return {
...x,
v: RESTReqSchemaVersion,
}
}
export function isHoppRESTRequest(x: any): x is HoppRESTRequest {
return x && typeof x === "object" && "v" in x
}