"use strict";
/* Return information about a given license. */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const get_license_1 = __importDefault(require("@cocalc/server/licenses/get-license"));
const get_account_1 = __importDefault(require("lib/account/get-account"));
const get_params_1 = __importDefault(require("lib/api/get-params"));
async function handle(req, res) {
    try {
        res.json(await get(req));
    }
    catch (err) {
        res.json({ error: err.message });
        return;
    }
}
exports.default = handle;
async function get(req) {
    const account_id = await (0, get_account_1.default)(req); // account_id = null is OK -- then get very minimal info about the license.
    const { license_id } = (0, get_params_1.default)(req);
    return await (0, get_license_1.default)(license_id, account_id);
}
//# sourceMappingURL=get-license.js.map