"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateSchema = void 0;
var fs = require("fs");
function generateSchema(entitiesPaths) {
    var data = [];
    for (var _i = 0, entitiesPaths_1 = entitiesPaths; _i < entitiesPaths_1.length; _i++) {
        var path = entitiesPaths_1[_i];
        if (path.endsWith("/*.entity.js")) {
            path = path.substring(0, path.length - "/*.entity.js".length);
        }
        if (!fs.existsSync(path)) {
            continue;
        }
        var files = fs.readdirSync(path);
        for (var index in files) {
            if (files[index].endsWith("ts"))
                continue;
            var entity = require(path + "/" + files[index]).default;
            if (!entity) {
                continue;
            }
            if (entity.adminUI) {
                data.push({ entity: entity, meta: entity.adminUI });
            }
        }
    }
    return data;
}
exports.generateSchema = generateSchema;
