@jungvonmatt/sb-migrate
Version:
CLI tool for managing Storyblok schema and content migrations
20 lines (19 loc) • 964 B
TypeScript
import { RunMigrationOptions } from "../../utils/migration";
/**
* Handles the deletion of a story based on the provided migration schema.
* This function performs the following operations:
* 1. Checks if the operation is a dry run
* 2. Retrieves the story using either numeric ID or slug
* 3. Verifies the story exists and has a valid ID
* 4. Deletes the story from the API
* 5. Logs the deletion status
*
* @param {Object} migration - The migration object containing the story ID
* @param {number | string} migration.id - The ID or slug of the story to delete
* @param {RunMigrationOptions} options - Configuration options for the migration
* @param {boolean} [options.isDryrun] - Whether to perform a dry run without making actual changes
* @throws {Error} If the story deletion fails or if the story is not found
*/
export declare const handleDeleteStory: (migration: {
id: number | string;
}, options: RunMigrationOptions) => Promise<void>;