"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.publishTemplate = exports.publishPage = exports.saveTemplateContent = exports.savePageContent = exports.fetchTemplateDsl = exports.fetchPageDsl = exports.fetchTemplateBuildVersion = exports.fetchPageLiveVersion = exports.fetchPageBuildVersion = void 0;
const api_agent_1 = __importDefault(require("@/utils/api-agent"));
const fetchPageBuildVersion = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/pages/build-versions', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchPageBuildVersion = fetchPageBuildVersion;
const fetchPageLiveVersion = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/pages/live-version', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchPageLiveVersion = fetchPageLiveVersion;
const fetchTemplateBuildVersion = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/templates/build-versions', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchTemplateBuildVersion = fetchTemplateBuildVersion;
const fetchPageDsl = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/pages/draft-infos', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchPageDsl = fetchPageDsl;
const fetchTemplateDsl = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/templates/draft-infos', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchTemplateDsl = fetchTemplateDsl;
const savePageContent = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/pages/versions', params, (rs) => {
        resolve(rs);
    });
});
exports.savePageContent = savePageContent;
const saveTemplateContent = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/templates/versions', params, (rs) => {
        resolve(rs);
    });
});
exports.saveTemplateContent = saveTemplateContent;
const publishPage = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/pages/publish', params, (rs) => {
        resolve(rs);
    });
});
exports.publishPage = publishPage;
const publishTemplate = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/templates/publish', params, (rs) => {
        resolve(rs);
    });
});
exports.publishTemplate = publishTemplate;
