"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchPageBuilderItems = exports.clonePage = exports.fetchTemplates = exports.publishTemplate = exports.publishPage = exports.updateTemplateDsl = exports.updatePageDsl = exports.fetchTemplateDsl = exports.fetchPageDsl = void 0;
const api_agent_1 = __importDefault(require("@/utils/api-agent"));
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 updatePageDsl = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/pages/versions', params, (rs) => {
        resolve(rs);
    });
});
exports.updatePageDsl = updatePageDsl;
const updateTemplateDsl = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/templates/versions', params, (rs) => {
        resolve(rs);
    });
});
exports.updateTemplateDsl = updateTemplateDsl;
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;
const fetchTemplates = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/templates', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchTemplates = fetchTemplates;
const clonePage = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/pages/clone', params, (rs) => {
        resolve(rs);
    });
});
exports.clonePage = clonePage;
const fetchPageBuilderItems = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/pages/builder-items', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchPageBuilderItems = fetchPageBuilderItems;
