Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kody/netlify

src/restore-deploy.js

18 lines · 831 B · JavaScript
import { restoreDeploy } from './netlify.js'

/**
 * Restore a previous deploy as the published production site.
 * Requires `dryRun: true` to preview or `confirm: true` to write.
 * @param {Object} input
 * @param {string} input.site Site id, name, or domain.
 * @param {string} input.deploy Deploy id to publish.
 * @param {boolean} [input.dryRun] Return the request preview without restoring.
 * @param {boolean} [input.confirm] Required for the live write.
 * @returns {Promise<Record<string, unknown>>} Restored deploy or dry-run preview.
 * @example
 * import restoreDeploy from 'kody:@kody/netlify/restore-deploy'
 * const preview = await restoreDeploy({ site: 'example-site', deploy: 'deploy_123', dryRun: true })
 */
export default async function restoreDeployEntrypoint(input = {}) {
	return await restoreDeploy(input)
}