"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.queryRecord = exports.updateRecord = exports.createRecord = void 0;
const cn_request_1 = require("@cainiaofe/cn-request");
/**
 * 新建记录
 * @param configs 鸟搭配置
 * @param contentParam 记录内容
 * @returns id 记录ID
 */
const createRecord = async (configs) => {
    return (0, cn_request_1.request)(configs)
        .then((recordId) => {
        return recordId;
    })
        .catch(() => {
        return '';
    });
};
exports.createRecord = createRecord;
/**
 * 更新记录
 * @param id 记录ID
 * @param configs 鸟搭配置
 * @param contentParam 记录内容
 * @returns
 */
const updateRecord = async (configs) => {
    return (0, cn_request_1.request)(configs)
        .then((res) => {
        return res;
    })
        .catch(() => {
        return false;
    });
};
exports.updateRecord = updateRecord;
const queryRecord = async ({ configs, id }) => {
    return (0, cn_request_1.request)({
        ...configs,
        data: {
            id,
        },
    })
        .then((res) => {
        return res;
    })
        .catch(() => {
        return null;
    });
};
exports.queryRecord = queryRecord;
