| 1 | import { GcpEnvironment } from "@/GCP/Environment"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { MinimumLogLevel } from "effect/References"; |
| 4 | |
| 5 | export const logLevel = Effect.provideService( |
| 6 | MinimumLogLevel, |
| 7 | process.env.DEBUG ? "Debug" : "Info", |
| 8 | ); |
| 9 | |
| 10 | export const currentProject = GcpEnvironment.current.pipe( |
| 11 | Effect.map((env) => env.project), |
| 12 | ); |
| 13 | export const location = "us-central1"; |
| 14 | |
| 15 | export const serviceAccountOf = (project: string) => |
| 16 | process.env.GCP_TEST_FIREBASE_APP_HOSTING_SA ?? |
| 17 | `alchemy-testing@${project}.iam.gserviceaccount.com`; |
| 18 | |
| 19 | export const missingBackendOf = |
| 20 | (project: string) => |
| 21 | (backendId = "alchemy-missing-backend") => |
| 22 | `projects/${project}/locations/${location}/backends/${backendId}`; |