worker.ts
This file
Path
apps/sandbox/src/worker.ts
50 lines · 1.3 KiB · TypeScript
Last changed by
Merge build/comments-ops into mainoscabrielbefore adoptione4c407e
History of this fileTake it
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051import type { CheckExit, CheckWire } from "@repo/checks/check-runner/wire";import type { BundleExit, BundleWire, ComposeExit, ComposeWire, LandExit, LandWire, MergeExit, MergeWire,} from "@repo/project/lander/wire";import { WorkerEntrypoint } from "cloudflare:workers";
import { runCheck } from "./checker.ts";import { runBundleRules, runCompose, runLand, runMerge } from "./lander.ts";
export { Checker } from "./checker.ts";
export { Lander } from "./lander.ts";
// `ctx.exports` holds a loopback only for the main module's exports.export { CloneGateway, EgressGateway } from "./outbound.ts";
export { EnvGateway } from "./env-gateway.ts";
export default class Sandbox extends WorkerEntrypoint<Env> { check(wire: typeof CheckWire.Encoded): Promise<typeof CheckExit.Encoded> { return runCheck(this.env, wire); }
merge(wire: typeof MergeWire.Encoded): Promise<typeof MergeExit.Encoded> { return runMerge(this.env, wire); }
land(wire: typeof LandWire.Encoded): Promise<typeof LandExit.Encoded> { return runLand(this.env, wire); }
compose( wire: typeof ComposeWire.Encoded ): Promise<typeof ComposeExit.Encoded> { return runCompose(this.env, wire); }
bundleRules( wire: typeof BundleWire.Encoded ): Promise<typeof BundleExit.Encoded> { return runBundleRules(this.env, wire); }}