import type { DiscoveredSite } from "../../authoring/index.js"; import type { Logger } from "../../shared/logger.js"; /** * Align the site-scoped media-library root with the folder the XM Cloud * Sites API actually scaffolded for the site. * * The derived root is `/sitecore/media library/Project//` * (the site's machine name, e.g. `duke-energy`) — but the Sites API * scaffolds the site's media folder under the site's DISPLAY name (e.g. * `Duke Energy`). Left unaligned, recipe pushes create a parallel * slug-named folder beside the scaffolded one and the media library * splits across two trees. * * Resolution (best-effort, fail-open to the configured root): * 1. An explicit `--media-library-root` flag is used verbatim — never * touched here (callers pass it through without calling this). * 2. Only roots whose leaf matches the site name are candidates for * alignment — an operator-customized root is left alone. * 3. The site's display name comes from site discovery; when a folder * named after it EXISTS in the media library, it wins (that's the * scaffolded folder Pages-authored uploads already land in). When * it doesn't exist, the configured root stands and is created on * demand exactly as before. */ export declare const alignMediaLibraryRootWithSite: (params: { /** Configured/derived root (env profile `recipeRoots.mediaLibrary`). */ configuredRoot: string | undefined; /** Explicit `--media-library-root` flag — used verbatim when set. */ explicitFlag?: string | undefined; /** Site machine name from the env profile (`site`). */ site: string | undefined; /** Site discovery — scai's `discoverSites`, injected for testability. */ discover: () => Promise; /** Batched existence lookup — the authoring client's `getItemsByPaths`. */ getItemsByPaths: (paths: readonly string[]) => Promise>; logger: Pick; }) => Promise;