The best way to control Claude Code, Codex and more from any computer or phone

main
ts 28 lines 1009 Bytes
Raw
1 import * as GCP from "@alchemy.run/gcp";
2 import * as Effect from "effect/Effect";
3 import { serveProbes } from "../../bindingHost.ts";
4 import TargetFunction from "./target-function.ts";
5
6 /**
7 * Effect-native Cloud Run service exercising every Cloud Functions binding
8 * as its own runtime service account. Deployed from
9 * {@link ../Bindings.test.ts}.
10 */
11 export default class CloudFunctionsBindingsHost extends GCP.Function<CloudFunctionsBindingsHost>()(
12 "CloudFunctionsBindingsHost",
13 { main: import.meta.url, invokerIamDisabled: true },
14 Effect.gen(function* () {
15 const getFunction = yield* GCP.CloudFunctions.GetFunction(TargetFunction);
16 const download = yield* GCP.CloudFunctions.GenerateDownloadUrl(TargetFunction);
17
18 return {
19 fetch: serveProbes({
20 getFunction: getFunction(),
21 generateDownloadUrl: download(),
22 }),
23 };
24 }).pipe(
25 Effect.provide(GCP.CloudFunctions.GetFunctionHttp),
26 Effect.provide(GCP.CloudFunctions.GenerateDownloadUrlHttp),
27 ),
28 ) {}