| 1 | import * as sasportal from "@distilled.cloud/gcp/sasportal_v1alpha1"; |
| 2 | import * as Effect from "effect/Effect"; |
| 3 | import { MinimumLogLevel } from "effect/References"; |
| 4 | |
| 5 | // Needs a SAS Portal (CBRS) customer (GCP_TEST_SASPORTAL_CUSTOMER); SAS |
| 6 | // Portal access is partner-provisioned and a plain project has no customer. |
| 7 | export const runLifecycle = !!process.env.GCP_TEST_SASPORTAL_CUSTOMER?.trim(); |
| 8 | |
| 9 | export const logLevel = Effect.provideService( |
| 10 | MinimumLogLevel, |
| 11 | process.env.DEBUG ? "Debug" : "Info", |
| 12 | ); |
| 13 | |
| 14 | export const firstCustomerName = Effect.gen(function* () { |
| 15 | const fromEnv = process.env.GCP_TEST_SASPORTAL_CUSTOMER?.trim(); |
| 16 | if (fromEnv && fromEnv.length > 0) { |
| 17 | return fromEnv.includes("/") ? fromEnv : `customers/${fromEnv}`; |
| 18 | } |
| 19 | const page = yield* sasportal.listCustomers({ pageSize: 10 }); |
| 20 | return page.customers?.[0]?.name ?? ""; |
| 21 | }); |
| 22 | |
| 23 | /** Constant CPI-signed-device probe body. Never generated at test time. */ |
| 24 | export const signedDeviceProbe = { |
| 25 | encodedDevice: |
| 26 | "eyJhbGciOiJub25lIn0.eyJkaXNwbGF5TmFtZSI6ImFsY2hlbXktc2FzcG9ydGFsLXByb2JlIiwiZmNjSWQiOiJURVNURkNDIiwic2VyaWFsTnVtYmVyIjoiQUxDSEVNWVBST0JFIn0.", |
| 27 | installerId: "alchemy-installer", |
| 28 | }; |