"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCustomObjects = void 0;
const utils_1 = require("../utils");
const getCustomObjects = async (request) => {
    try {
        const response = await request(`${utils_1.enchargeRestAPIBase}/schemas`, {
            method: 'GET'
        });
        const choices = response?.data?.objects.map((object) => ({
            label: object.displayNameSingular,
            value: object.name
        }));
        return {
            choices
        };
    }
    catch (err) {
        return {
            choices: [],
            error: {
                message: err?.message,
                code: err?.name
            }
        };
    }
};
exports.getCustomObjects = getCustomObjects;
//# sourceMappingURL=getCustomObjects.js.map