import { logger } from "../util/logger.js";
import { safeFetch } from "../util/safe-fetch.js";
export async function updateNameservers(options) {
    const url = `https://api.godaddy.com/v1/domains/${options.domain}/nameservers`;
    const response = await safeFetch(url, {
        method: "PUT",
        headers: {
            Authorization: `sso-key ${options.apiKey}:${options.apiSecret}`,
            "Content-Type": "application/json",
            Accept: "application/json",
        },
        body: JSON.stringify({
            nameservers: options.nameservers,
        }),
    });
    if (response.ok) {
        logger.log(`✅ Nameservers updated for ${options.domain}`);
    }
    else {
        const error = await response.json();
        logger.error("❌ Failed to update nameservers:", error);
    }
}
//# sourceMappingURL=godaddy.js.map