"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.fetchConditionDetail = exports.updateConditionVersion = exports.deleteCondition = exports.publishCondition = exports.updateCondition = exports.addCondition = exports.fetchAppConditions = exports.fetchConditions = void 0;
const api_agent_1 = __importDefault(require("@/utils/api-agent"));
const fetchConditions = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/condition-searchs', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchConditions = fetchConditions;
const fetchAppConditions = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/conditions/file-searchs', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchAppConditions = fetchAppConditions;
const addCondition = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/conditions', params, (rs) => {
        resolve(rs);
    });
});
exports.addCondition = addCondition;
const updateCondition = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/conditions', params, (rs) => {
        resolve(rs);
    });
});
exports.updateCondition = updateCondition;
const publishCondition = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/conditions/version-publish', params, (rs) => {
        resolve(rs);
    });
});
exports.publishCondition = publishCondition;
const deleteCondition = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/conditions/status', params, (rs) => {
        resolve(rs);
    });
});
exports.deleteCondition = deleteCondition;
const updateConditionVersion = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/conditions/versions', params, (rs) => {
        resolve(rs);
    });
});
exports.updateConditionVersion = updateConditionVersion;
const fetchConditionDetail = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/conditions/build-versions?', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchConditionDetail = fetchConditionDetail;
