import { __awaiter } from "tslib";
import { relationsExportExtractor } from '@anglr/dynamic/relations';
/**
 * Extracts dynamic relations node from default locations
 */
export const relationsNodeExtractor = (module, logger) => __awaiter(void 0, void 0, void 0, function* () {
    const relations = yield relationsExportExtractor(module, logger);
    logger === null || logger === void 0 ? void 0 : logger.debug('relationsNodeExtractor: trying to extract dynamic node');
    if (!relations) {
        return null;
    }
    const nodeMeta = relations.data;
    if (!nodeMeta) {
        return null;
    }
    const metadata = yield nodeMeta.relationsEditorMetadata;
    if (!metadata) {
        return null;
    }
    return {
        data: metadata.nodeDefinition,
        metaInfo: metadata.metaInfo,
    };
});
//# sourceMappingURL=relationsNode.extractor.js.map