Skip to content
← Public packages

@apphub/netlify

Inspect Netlify sites, deploys, env-var metadata, and forms on the caller's account, with dry-run writes.

src/restore-deploy.js

18 lines · 833 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:@apphub/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)
}