"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
const _axios = /*#__PURE__*/ _interop_require_default(require("axios"));
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const fetchReleases = async ()=>{
    try {
        const response = await _axios.default.get("https://api.github.com/repos/fdm-monster/fdm-monster-client-next/releases");
        const releases = response.data;
        const releaseData = releases.map((release)=>({
                tag_name: release.tag_name,
                name: release.name,
                published_at: release.published_at,
                body: release.body
            }));
        const outputPath = _path.default.join(__dirname, "github-releases-client-slim-oct-2024.data.json");
        _fs.default.writeFileSync(outputPath, JSON.stringify(releaseData, null, 2));
        console.log(`Releases data written to ${outputPath}`);
    } catch (error) {
        console.error("Error fetching releases:", error);
    }
};
const fetchLatest = async ()=>{
    try {
        const response = await _axios.default.get("https://api.github.com/repos/fdm-monster/fdm-monster-client-next/releases/latest");
        const release = response.data;
        const releaseData = {
            tag_name: release.tag_name,
            name: release.name,
            published_at: release.published_at,
            body: release.body
        };
        const outputPath = _path.default.join(__dirname, "github-releases-latest-client-slim.data.json");
        _fs.default.writeFileSync(outputPath, JSON.stringify(releaseData, null, 2));
        console.log(`Releases data written to ${outputPath}`);
    } catch (error) {
        console.error("Error fetching releases:", error);
    }
};
fetchReleases();
fetchLatest();

//# sourceMappingURL=download-github-releases.js.map