import { ApiError } from './api'; import type { CliCredentials } from './config'; export type PackagePin = { packageId: string; version: string; manifestCid: string; }; export type SetItemVersionOptions = { packageVersion: string; reason: string; expectedCurrentVersionId?: string; /** Platform admins only: move an item another account created, through the admin route (same gates, same body). */ asAdmin?: boolean; }; export type SetItemVersionResult = { itemId: string; /** 'update' (a new revision) or 'rollback' (an earlier revision made current again). */ move?: 'update' | 'rollback'; /** A vehicle move: the sha256 of the vehiclePackage rider sent with the pin. */ vehiclePackageSha256?: string; regressions?: unknown[]; revision: number; packagePin: PackagePin; previousRevision: number | null; previousPackagePin: PackagePin | null; reach?: Record; [k: string]: unknown; }; type Requester = { request(method: string, path: string, body?: unknown): Promise; }; /** The request body, validated; a pure function so the wire shape is tested without a network. */ export declare function buildSetVersionBody(pin: PackagePin, options: SetItemVersionOptions): Record; type ItemRow = { continuumPackagePin?: { packageId?: string; version?: string; } | null; properties?: Record | null; }; type RootRef = { cid?: string; bytes?: number; mediaType?: string; role?: string; }; /** Resolve {packageId, version, manifestCid} for `version` of the item's pinned Package from the public API. */ export declare function resolvePackagePin(api: Requester, itemId: string, version: string, deps?: { publicGet?: (path: string) => Promise; item?: ItemRow; }): Promise; /** The route a move is posted to: the creator's, or (`--as-admin`) the admin one for an item somebody else created. */ export declare function setVersionPath(itemId: string, asAdmin: boolean | undefined): string; export declare const VEHICLE_DEFINITION_ROLE = "vehicle-definition"; type ShelfRow = { revision: number; current: boolean; packagePin: PackagePin; }; /** The item's own revision of `version`, if it ever had one (then the move is a rollback, not an update). */ export declare function revisionOf(shelf: { versions?: ShelfRow[]; } | null, packageId: string | undefined, version: string): ShelfRow | undefined; /** The sealed vehicle root of a Package Version, verified against its manifest descriptor: the `vehiclePackage` rider. */ export declare function sealedVehicleRoot(itemId: string, pin: PackagePin, root: RootRef | undefined, fetchObject: (sha: string) => Promise): Promise<{ vehiclePackage: Record; sha256: string; }>; export declare function setItemVersion(itemId: string, options: SetItemVersionOptions, credentials: CliCredentials, deps?: { api?: Requester; fetchObject?: (sha: string) => Promise; }): Promise; /** Terminal lines for a refused move. A 422 leads with the server's message (the plain reason), then the * `remedy` and any hosted render the refusal queued. Anything else renders as the generic API error. */ export declare function renderSetVersionError(error: ApiError): string; export declare function renderSetVersionSuccess(r: SetItemVersionResult): string[]; export {};