"use strict";
/*
Return the entire customize object for the site, or
a subset of fields (to cut down on bandwidth).

This calls something that is LRU cached on the server for a few seconds.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const customize_1 = __importDefault(require("@cocalc/server/settings/customize"));
const misc_1 = require("@cocalc/util/misc");
const get_params_1 = __importDefault(require("lib/api/get-params"));
async function handle(req, res) {
    const { fields } = (0, get_params_1.default)(req);
    try {
        const customize = await (0, customize_1.default)();
        let result = fields ? (0, misc_1.copy_with)(customize, fields) : customize;
        res.json(result);
    }
    catch (err) {
        res.json({ error: `${err.message}` });
    }
}
exports.default = handle;
//# sourceMappingURL=customize.js.map