"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.revokeFromStore = exports.commitToStore = exports.publish = exports.searchVariable = exports.deleteVariable = exports.updateVariableContent = exports.updateVariables = exports.addVariables = exports.getVariableBuildVersion = exports.fetchVariables = exports.fetchAppVariables = void 0;
const api_agent_1 = __importDefault(require("@/utils/api-agent"));
// fetchApplicationVariables
const fetchAppVariables = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/variables/file-searchs', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchAppVariables = fetchAppVariables;
// getVariables
const fetchVariables = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/variable-searchs', params, (rs) => {
        resolve(rs);
    });
});
exports.fetchVariables = fetchVariables;
const getVariableBuildVersion = (params) => new Promise((resolve) => {
    api_agent_1.default.get('/variables/build-versions', params, (rs) => {
        resolve(rs);
    });
});
exports.getVariableBuildVersion = getVariableBuildVersion;
const addVariables = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/variables', params, (rs) => {
        resolve(rs);
    });
});
exports.addVariables = addVariables;
const updateVariables = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/variables', params, (rs) => {
        resolve(rs);
    });
});
exports.updateVariables = updateVariables;
const updateVariableContent = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/variables/contents', params, (rs) => {
        resolve(rs);
    });
});
exports.updateVariableContent = updateVariableContent;
const deleteVariable = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/variables/status', params, (rs) => {
        resolve(rs);
    });
});
exports.deleteVariable = deleteVariable;
const searchVariable = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/variables/scope-infos', params, (rs) => {
        resolve(rs);
    });
});
exports.searchVariable = searchVariable;
// publish
const publish = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/variables/version-publish', params, (rs) => {
        resolve(rs);
    });
});
exports.publish = publish;
// store related
const commitToStore = (params) => new Promise((resolve) => {
    api_agent_1.default.post('/stores/goods', params, (rs) => {
        resolve(rs);
    });
});
exports.commitToStore = commitToStore;
const revokeFromStore = (params) => new Promise((resolve) => {
    api_agent_1.default.put('/stores/goods-offline', params, (rs) => {
        resolve(rs);
    });
});
exports.revokeFromStore = revokeFromStore;
