"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.publishMock = exports.updateMock = exports.saveMock = exports.fetchMock = void 0;
const api_agent_1 = __importDefault(require("@/utils/api-agent"));
const fetchMock = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/mocks/build-versions', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchMock = fetchMock;
const saveMock = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/mocks', params, (rs) => {
        resolve(rs);
    });
});
exports.saveMock = saveMock;
const updateMock = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/mocks/versions', params, (rs) => {
        resolve(rs);
    });
});
exports.updateMock = updateMock;
const publishMock = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/mocks/version-publish', params, (rs) => {
        resolve(rs);
    });
});
exports.publishMock = publishMock;
