| 1 | import { GcpEnvironment } from "@/GCP/Environment"; |
| 2 | import { MinimumLogLevel } from "effect/References"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | |
| 5 | export const logLevel = Effect.provideService( |
| 6 | MinimumLogLevel, |
| 7 | process.env.DEBUG ? "Debug" : "Info", |
| 8 | ); |
| 9 | |
| 10 | // Cloud Talent Solution needs a console-only data-permission opt-in |
| 11 | // (GCP_TEST_TALENT_ONBOARDED=1). Without it, every call except deletes fails |
| 12 | // with `BadRequest: Service must be permitted to access job and behavioral |
| 13 | // data to improve common machine learning models ...`. |
| 14 | export const runLifecycle = !!process.env.GCP_TEST_TALENT_ONBOARDED; |
| 15 | |
| 16 | export const currentProject = GcpEnvironment.current.pipe( |
| 17 | Effect.map((env) => env.project), |
| 18 | ); |