mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-14 22:37:44 +02:00
30 lines
1 KiB
TypeScript
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" },
|
|
});
|