Fork Horse repository, listed by its owner. Publisher snapshot.
packages/forkhorse-gatekeeper/src/worker/configurator.ts
Snapshot at 34e3175
1import { RpcStub, RpcTarget } from "cloudflare:workers";
2import { validateRpc } from "capnweb-validate";
3import type { GatekeeperUiFrame } from "@gadgets/workshop-shared/gatekeeper";
4import { checkConnectionDraft, type ConnectionDraft, type DraftStatus } from "../configuration.ts";
5
6/** Fixture-only format checking. Production connection uses the account popup. */
7@validateRpc()
8export class ConnectionDraftUiImpl extends RpcTarget {
9 async checkDraft(draft: ConnectionDraft): Promise<DraftStatus> {
10 return checkConnectionDraft(draft);
11 }
12}
13
14export function createConnectionDraftFrame(iframeHtml: string): GatekeeperUiFrame {
15 return { iframeHtml, ui: new RpcStub(new ConnectionDraftUiImpl()) };
16}
17