t3-code-android-nightly/.repos/alchemy-effect/packages/alchemy/test/GCP/Vault/common.ts
Julius Marminge 6f9cea00ae
chore(refs): sync Effect and Alchemy references to 4.0.1 and beta.80 (#16170)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-05 13:22:30 -07:00

30 lines
1 KiB
TypeScript

import * as vault from "@distilled.cloud/gcp/vault_v1";
import * as Effect from "effect/Effect";
import { MinimumLogLevel } from "effect/References";
// Vault needs a Workspace customer with Vault licenses; the testing
// service account gets Forbidden "Request had insufficient authentication
// scopes." Set GCP_TEST_VAULT=1 (and GCP_TEST_VAULT_ACCOUNT) on one.
export const runLifecycle = !process.env.FAST && !!process.env.GCP_TEST_VAULT;
export const vaultAccount = process.env.GCP_TEST_VAULT_ACCOUNT?.trim();
export const runAccountLifecycle = runLifecycle && !!vaultAccount;
export const logLevel = Effect.provideService(
MinimumLogLevel,
process.env.DEBUG ? "Debug" : "Info",
);
export const sampleMailQuery = (email: string): vault.Query => ({
corpus: "MAIL",
dataScope: "ALL_DATA",
searchMethod: "ACCOUNT",
accountInfo: { emails: [email] },
terms: "subject:alchemy",
timeZone: "America/Los_Angeles",
});
export const sampleMailExportOptions = (): vault.ExportOptions => ({
mailOptions: { exportFormat: "MBOX" },
});