import type { CommonOptions } from "../../shared/cli-options.js"; /** * `scai provision deploy env-file` — write/update a Content SDK head app's * `.env.local` by looking up the live connection values from the Deploy API: * the **Edge context ids** (`GET /api/environments/v2/{id}` → `previewContextId` * + `liveContextId`) and the **editing secret** (`obtain-editing-secret`). The * preview context id is the editing-host default (`SITECORE_EDGE_CONTEXT_ID`); * the live one is written as `SITECORE_EDGE_LIVE_CONTEXT_ID`. Fills the site * name / language from the env profile. Merges into an existing file — only the * managed keys are upserted; anything else you've set is preserved. * * NB: the edge-token `apiKey` is NOT a context id — the SDK's `sitecore_context_id` * is the environment's preview/live context id, which only the environment GET * returns. (This mirrors how the orchestrator resolves them.) * * Replaces the bespoke `.env.local` generation each head-app pipeline otherwise * hand-rolls. Pair with `deploy build-config` (the xmcloud.build.json writer). */ export type DeployEnvFileOptions = CommonOptions & { environmentName?: string; /** SXA site name for NEXT_PUBLIC_DEFAULT_SITE_NAME. Falls back to the profile's `site`. */ site?: string; /** Default language. Defaults to `en`. */ language?: string; /** Path to write. Defaults to ./.env.local. */ output?: string; whatIf?: boolean; }; /** Keys this command owns; everything else in the file is preserved verbatim. */ export declare const MANAGED_ENV_KEYS: readonly ["SITECORE_EDGE_CONTEXT_ID", "NEXT_PUBLIC_SITECORE_EDGE_CONTEXT_ID", "SITECORE_EDGE_LIVE_CONTEXT_ID", "SITECORE_EDITING_SECRET", "NEXT_PUBLIC_DEFAULT_SITE_NAME", "NEXT_PUBLIC_DEFAULT_LANGUAGE"]; /** * Upsert `KEY=VALUE` pairs into existing dotenv content: matching keys are * replaced in place, new keys appended, all other lines (comments, blanks, * unmanaged vars) preserved. Pure — exposed for unit tests. */ export declare const upsertEnvVars: (existing: string, vars: Record) => string; export declare const runDeployEnvFile: (options: DeployEnvFileOptions) => Promise;