/** * `scai content publish unpublish` — composite verb. * * The SAI Publishing API has no per-version unpublish operation. The * Sitecore-canonical mechanism is to change the item's publish-state * fields via the Authoring API (so the next publish doesn't pick them * up — or, for already-published items, the next publish removes them * from Edge) and then submit a regular publish job. * * Three strategies: * * - `never-publish` (default, reversible) — sets `__Never publish: true` * on the latest version per requested language. Reverse by writing * `__Never publish: false` (e.g. `scai content version * set-never-publish --value false`) and republishing. * - `expire-now` (reversible) — sets `__Valid to: ` * on each targeted version. Reverse by writing `__Valid to` to a * future date. * - `delete` (destructive, NOT reversible from scai's side) — runs * through `runDeleteUnpublish` in `unpublish-delete.ts`. * * Safety model reuses the four PR 2b primitives: dry-run default, * scope-token verification on production-tier envs, `--allow-write` * to graduate from dry-run, audit log every mutation with before/after * captures so an operator can reverse a mistaken toggle by reading the * log. * * This file orchestrates the high-level flow; per-strategy logic lives * in sibling files: * - `unpublish-strategies.ts` — `applyStrategy` (never-publish / expire-now) * - `unpublish-delete.ts` — `runDeleteUnpublish` (delete flow) */ import { type UnpublishStrategy } from "../../shared/publish-audit.js"; export interface RunPublishUnpublishOptions { config?: string; environmentName?: string; itemIds?: string[]; paths?: string[]; /** Site name. Resolves to the site's content-tree root via Sites * API + Authoring GraphQL. Combine with `--include-subitems` to * unpublish the whole site. */ site?: string; /** Literal language list. See `PublishLocaleOptions`. */ languages?: string[]; /** Resolve languages from the named site via Sites API. */ languagesFromSite?: string; /** Resolve languages from the tenant-wide registered set. */ allTenantLanguages?: boolean; includeSubitems?: boolean; includeRelated?: boolean; /** Defaults to `"never-publish"`. */ strategy?: UnpublishStrategy; /** * For `--strategy delete` on production-tier envs: the operator * must echo the item path back literally before scai will call * `deleteItem`. The CLI prompts interactively when unset; CI must * supply this matching the resolved item path. (Mirrors `publish * all`'s typed env-name gate, scaled per-item.) */ confirmItemPath?: string; whatIf?: boolean; allowWrite?: boolean; confirmToken?: string; yes?: boolean; name?: string; source?: string; verbose?: boolean; trace?: boolean; quiet?: boolean; json?: boolean; logFile?: string; nonInteractive?: boolean; } export declare const runPublishUnpublish: (options: RunPublishUnpublishOptions) => Promise;