- Updated `poc.js` to support queries for multiple object types (seekers, jobads, recruiters, etc.) with intelligent routing based on natural language input. - Implemented a query validation mechanism to prevent excessive or sensitive requests. - Introduced a mapping manager for dynamic schema handling and object detection. - Enhanced the response schema generation to accommodate various object types and their respective fields. - Added a new script `verify-mapping.js` to verify and display the mapping details for the seekers schema, including available properties, indexes, access rights, and synonyms.
39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
import { ODMDBMappingManager } from "./schema-mappings/mapping-manager.js";
|
|
|
|
const mgr = new ODMDBMappingManager();
|
|
const seekersMapping = mgr.getMapping("seekers");
|
|
|
|
console.log("=== SEEKERS MAPPING VERIFICATION ===");
|
|
console.log("Available:", seekersMapping?.available);
|
|
console.log("Property count:", seekersMapping?.propertyCount);
|
|
console.log("");
|
|
|
|
console.log("=== INDEXES ===");
|
|
console.log("Indexes from schema:", seekersMapping?.indexes?.length || 0);
|
|
seekersMapping?.indexes?.forEach((idx) => {
|
|
console.log(`- ${idx.name} (${idx.type}) on ${idx.keyval}`);
|
|
});
|
|
console.log("");
|
|
|
|
console.log("=== ACCESS RIGHTS ===");
|
|
console.log(
|
|
"Recruiters readable fields:",
|
|
seekersMapping?.accessRights?.recruiters?.R?.length || 0
|
|
);
|
|
console.log(
|
|
"First 10 readable fields:",
|
|
seekersMapping?.accessRights?.recruiters?.R?.slice(0, 10) || []
|
|
);
|
|
console.log("");
|
|
|
|
console.log("=== PROPERTIES SAMPLE ===");
|
|
const propKeys = Object.keys(seekersMapping?.properties || {});
|
|
console.log("Total properties:", propKeys.length);
|
|
console.log("First 10 properties:", propKeys.slice(0, 10));
|
|
console.log("");
|
|
|
|
console.log("=== SYNONYMS SAMPLE ===");
|
|
const synonymKeys = Object.keys(seekersMapping?.synonyms || {});
|
|
console.log("Total synonyms:", synonymKeys.length);
|
|
console.log("First 10 synonyms:", synonymKeys.slice(0, 10));
|