@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 22 lines 908 Bytes
Raw
1 import * as cloudfunctions from "@distilled.cloud/gcp/cloudfunctions_v2";
2 import * as Layer from "effect/Layer";
3 import { makeFunctionHttpBinding } from "./BindingHttp.ts";
4 import { GenerateDownloadUrl } from "./GenerateDownloadUrl.ts";
5
6 /**
7 * HTTP implementation of {@link GenerateDownloadUrl}.
8 *
9 * @layer
10 * @provides GCP.CloudFunctions.GenerateDownloadUrl
11 */
12 export const GenerateDownloadUrlHttp = Layer.effect(
13 GenerateDownloadUrl,
14 makeFunctionHttpBinding({
15 tag: "GCP.CloudFunctions.GenerateDownloadUrl",
16 // Narrowest predefined role with cloudfunctions.functions.sourceCodeGet.
17 // 2nd gen functions accept only invoker roles on their own IAM policy,
18 // so grant on the project under a condition naming the function.
19 iam: { role: "roles/cloudfunctions.developer", scopeByCondition: true },
20 operation: cloudfunctions.generateDownloadUrlProjectsLocationsFunctions,
21 }),
22 );