it's not done but I'm too scared of losing this work to not commit

This commit is contained in:
Spencer Pogorzelski 2023-08-11 19:14:46 -07:00
parent 636cdbf561
commit bcaf437fd3
6 changed files with 498 additions and 39 deletions

View file

@ -29,11 +29,26 @@ export class AdriftBareClient extends Client {
duplex: string | undefined,
signal: AbortSignal | undefined
): Promise<BareResponse> {
let rawResponse = await this.connection.httprequest({ a: "test data" });
if (
body !== null &&
typeof body !== "undefined" &&
typeof body !== "string"
) {
console.log({ body });
throw new Error("bare-client-custom passed an unexpected body type");
}
let rawResponse = await this.connection.httprequest({
method,
requestHeaders,
body,
remote,
cache,
duplex,
});
return new Response(JSON.stringify(rawResponse)) as BareResponse;
}
async connect(
connect(
remote: URL,
protocols: string[],
getRequestHeaders: GetRequestHeadersCallback,