import { B2CInstance } from '../../instance/index.js';
import { type JobExecution, type WaitForJobOptions } from './run.js';
/**
 * Options for site archive import.
 */
export interface SiteArchiveImportOptions {
    /** Keep archive on instance after import (default: false) */
    keepArchive?: boolean;
    /** Wait options for job completion */
    waitOptions?: WaitForJobOptions;
}
/**
 * Result of a site archive import.
 */
export interface SiteArchiveImportResult {
    /** Job execution details */
    execution: JobExecution;
    /** Archive filename on instance */
    archiveFilename: string;
    /** Whether archive was kept on instance */
    archiveKept: boolean;
}
/**
 * Imports a site archive to a B2C Commerce instance.
 *
 * Supports importing from:
 * - A local directory (will be zipped automatically)
 * - A local zip file
 * - A Buffer containing zip data
 * - A filename already on the instance (in Impex/src/instance/)
 *
 * **Buffer handling:** When passing a Buffer, the `archiveName` option controls
 * the contract:
 * - **Without `archiveName`:** The buffer should contain archive entries without
 *   a root directory (e.g. `libraries/mylib/library.xml`). The SDK generates
 *   an archive name and wraps the contents under it.
 * - **With `archiveName`:** The buffer must already be correctly structured with
 *   `archiveName/` as the top-level directory. It is uploaded as-is.
 *
 * @param instance - B2C instance to import to
 * @param target - Source to import (directory path, zip file path, Buffer, or remote filename)
 * @param options - Import options
 * @returns Import result with execution details
 * @throws JobExecutionError if import job fails
 *
 * @example
 * ```typescript
 * // Import from a local directory
 * const result = await siteArchiveImport(instance, './my-site-data');
 *
 * // Import from a zip file
 * const result = await siteArchiveImport(instance, './export.zip');
 *
 * // Import from a buffer (SDK wraps contents automatically)
 * const zip = new JSZip();
 * zip.file('libraries/mylib/library.xml', xmlContent);
 * const buffer = await zip.generateAsync({type: 'nodebuffer'});
 * const result = await siteArchiveImport(instance, buffer);
 *
 * // Import from a buffer with explicit archive name (caller owns structure)
 * const zip = new JSZip();
 * zip.file('my-import/libraries/mylib/library.xml', xmlContent);
 * const buffer = await zip.generateAsync({type: 'nodebuffer'});
 * const result = await siteArchiveImport(instance, buffer, {
 *   archiveName: 'my-import'
 * });
 *
 * // Import from existing file on instance
 * const result = await siteArchiveImport(instance, {
 *   remoteFilename: 'existing-archive.zip'
 * });
 * ```
 */
export declare function siteArchiveImport(instance: B2CInstance, target: string | Buffer | {
    remoteFilename: string;
    archiveName?: string;
}, options?: SiteArchiveImportOptions & {
    archiveName?: string;
}): Promise<SiteArchiveImportResult>;
/**
 * Configuration for sites in export.
 */
export interface ExportSitesConfiguration {
    ab_tests?: boolean;
    active_data_feeds?: boolean;
    all?: boolean;
    cache_settings?: boolean;
    campaigns_and_promotions?: boolean;
    content?: boolean;
    coupons?: boolean;
    custom_objects?: boolean;
    customer_cdn_settings?: boolean;
    customer_groups?: boolean;
    distributed_commerce_extensions?: boolean;
    dynamic_file_resources?: boolean;
    gift_certificates?: boolean;
    ocapi_settings?: boolean;
    payment_methods?: boolean;
    payment_processors?: boolean;
    redirect_urls?: boolean;
    search_settings?: boolean;
    shipping?: boolean;
    site_descriptor?: boolean;
    site_preferences?: boolean;
    sitemap_settings?: boolean;
    slots?: boolean;
    sorting_rules?: boolean;
    source_codes?: boolean;
    static_dynamic_alias_mappings?: boolean;
    stores?: boolean;
    tax?: boolean;
    url_rules?: boolean;
}
/**
 * Configuration for global data in export.
 */
export interface ExportGlobalDataConfiguration {
    access_roles?: boolean;
    all?: boolean;
    csc_settings?: boolean;
    csrf_whitelists?: boolean;
    custom_preference_groups?: boolean;
    custom_quota_settings?: boolean;
    custom_types?: boolean;
    geolocations?: boolean;
    global_custom_objects?: boolean;
    job_schedules?: boolean;
    job_schedules_deprecated?: boolean;
    locales?: boolean;
    meta_data?: boolean;
    oauth_providers?: boolean;
    ocapi_settings?: boolean;
    page_meta_tags?: boolean;
    preferences?: boolean;
    price_adjustment_limits?: boolean;
    services?: boolean;
    sorting_rules?: boolean;
    static_resources?: boolean;
    system_type_definitions?: boolean;
    users?: boolean;
    webdav_client_permissions?: boolean;
}
/**
 * Data units configuration for export.
 */
export interface ExportDataUnitsConfiguration {
    /** Catalog static resources to export (catalog_id: true) */
    catalog_static_resources?: Record<string, boolean>;
    /** Catalogs to export (catalog_id: true) */
    catalogs?: Record<string, boolean>;
    /** Customer lists to export (list_id: true) */
    customer_lists?: Record<string, boolean>;
    /** Inventory lists to export (list_id: true) */
    inventory_lists?: Record<string, boolean>;
    /** Library static resources to export (library_id: true) */
    library_static_resources?: Record<string, boolean>;
    /** Libraries to export (library_id: true) */
    libraries?: Record<string, boolean>;
    /** Price books to export (pricebook_id: true) */
    price_books?: Record<string, boolean>;
    /** Sites to export (site_id: ExportSitesConfiguration) */
    sites?: Record<string, Partial<ExportSitesConfiguration> | boolean>;
    /** Global data to export */
    global_data?: Partial<ExportGlobalDataConfiguration>;
}
/**
 * Options for site archive export.
 */
export interface SiteArchiveExportOptions {
    /** Wait options for job completion */
    waitOptions?: WaitForJobOptions;
}
/**
 * Result of a site archive export.
 */
export interface SiteArchiveExportResult {
    /** Job execution details */
    execution: JobExecution;
    /** Archive filename on instance */
    archiveFilename: string;
}
/**
 * Exports a site archive from a B2C Commerce instance.
 *
 * @param instance - B2C instance to export from
 * @param dataUnits - Data units configuration specifying what to export
 * @param options - Export options
 * @returns Export result with archive data
 * @throws JobExecutionError if export job fails
 *
 * @example
 * ```typescript
 * // Export global meta data
 * const result = await siteArchiveExport(instance, {
 *   global_data: { meta_data: true }
 * });
 *
 * // Export a site's content
 * const result = await siteArchiveExport(instance, {
 *   sites: {
 *     'RefArch': { content: true, site_preferences: true }
 *   }
 * });
 *
 * // Export catalogs
 * const result = await siteArchiveExport(instance, {
 *   catalogs: { 'storefront-catalog': true }
 * });
 * ```
 */
export declare function siteArchiveExport(instance: B2CInstance, dataUnits: Partial<ExportDataUnitsConfiguration>, options?: SiteArchiveExportOptions): Promise<SiteArchiveExportResult>;
/**
 * Exports a site archive and downloads it to memory.
 *
 * Runs the export job on the instance, downloads the archive via WebDAV,
 * and returns the data as a Buffer. Optionally keeps the archive on the instance.
 *
 * @param instance - B2C instance to export from
 * @param dataUnits - Data units configuration specifying what to export
 * @param options - Export and download options
 * @returns Export result with archive data buffer
 *
 * @example
 * ```typescript
 * const result = await siteArchiveExportDownload(instance, {
 *   global_data: { meta_data: true }
 * });
 * const zip = await JSZip.loadAsync(result.data);
 * ```
 */
export declare function siteArchiveExportToBuffer(instance: B2CInstance, dataUnits: Partial<ExportDataUnitsConfiguration>, options?: SiteArchiveExportOptions & {
    keepArchive?: boolean;
}): Promise<SiteArchiveExportResult & {
    data: Buffer;
    archiveKept: boolean;
}>;
/**
 * Exports a site archive, downloads it, and saves it to a local path.
 *
 * Runs the export job on the instance, downloads the archive via WebDAV,
 * and saves it locally. Optionally keeps the archive on the instance.
 *
 * @param instance - B2C instance to export from
 * @param dataUnits - Data units configuration
 * @param outputPath - Local path to save the archive
 * @param options - Export and download options
 * @returns Export result with local path
 *
 * @example
 * ```typescript
 * // Export and save to a directory (extracts zip)
 * await siteArchiveExportToPath(instance, { global_data: { meta_data: true } }, './exports');
 *
 * // Export and save as zip
 * await siteArchiveExportToPath(instance, { global_data: { meta_data: true } }, './exports/archive.zip');
 * ```
 */
export declare function siteArchiveExportToPath(instance: B2CInstance, dataUnits: Partial<ExportDataUnitsConfiguration>, outputPath: string, options?: SiteArchiveExportOptions & {
    keepArchive?: boolean;
    extractZip?: boolean;
}): Promise<SiteArchiveExportResult & {
    localPath: string;
    archiveKept: boolean;
}>;
