@jungvonmatt/sb-migrate
Version:
CLI tool for managing Storyblok schema and content migrations
47 lines (46 loc) • 2.05 kB
TypeScript
import { StoryblokConfig } from "../types/config";
/**
* Loads environment variables from the .env file.
*
* @returns {Promise<Partial<StoryblokConfig>>} A promise that resolves to the loaded configuration
*/
export declare function loadEnvConfig(): Promise<Partial<StoryblokConfig>>;
/**
* Saves the configuration to a file.
*
* @param {StoryblokConfig} config - The configuration to save
* @returns {Promise<void>} A promise that resolves when the configuration is saved
*/
export declare function saveConfig(config: StoryblokConfig): Promise<void>;
/**
* Loads the configuration from the .storyblokrc.json file.
*
* @returns {Promise<StoryblokConfig | null>} A promise that resolves to the loaded configuration or null if not found
*/
export declare function loadConfig(): Promise<StoryblokConfig | null>;
/**
* Verifies and potentially updates an existing Storyblok configuration.
*
* This function:
* 1. Displays current configuration values (spaceId, oauthToken, region)
* 2. Asks user if they want to use existing values
* 3. If user declines or values are missing, prompts for new values
* 4. Ensures all required fields are present in the final configuration
*
* @param config - Partial configuration object containing existing values
* @returns A complete StoryblokConfig object if user confirms or updates values, null if user declines
*/
export declare function verifyExistingConfig(config: Partial<StoryblokConfig>): Promise<StoryblokConfig | null>;
/**
* Prompts the user for all required Storyblok configuration values.
*
* This function:
* 1. Prompts for Space ID with validation
* 2. Prompts for OAuth Token with validation
* 3. Prompts for Region with predefined options
* 4. Uses existing values as defaults if provided
*
* @param existing - Partial configuration object containing existing values to use as defaults
* @returns A complete StoryblokConfig object with all required fields
*/
export declare function promptForConfig(existing: Partial<StoryblokConfig>): Promise<StoryblokConfig>;