n8n-nodes-inflow-crm
Version:
Official Inflow CRM integration for n8n. Create, update, search records and handle webhooks with dynamic field support.
26 lines (25 loc) • 987 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.__clearFieldMetadataCache = exports.getCachedFieldMeta = exports.cacheModuleFields = void 0;
const fieldMetadataCache = {};
function cacheModuleFields(moduleName, fields) {
if (!moduleName || !Array.isArray(fields))
return;
if (!fieldMetadataCache[moduleName]) {
fieldMetadataCache[moduleName] = {};
}
fields.forEach(field => {
if (field && field.apiFieldName) {
fieldMetadataCache[moduleName][field.apiFieldName] = field;
}
});
}
exports.cacheModuleFields = cacheModuleFields;
function getCachedFieldMeta(moduleName, apiFieldName) {
return fieldMetadataCache[moduleName]?.[apiFieldName];
}
exports.getCachedFieldMeta = getCachedFieldMeta;
function __clearFieldMetadataCache() {
Object.keys(fieldMetadataCache).forEach(module => delete fieldMetadataCache[module]);
}
exports.__clearFieldMetadataCache = __clearFieldMetadataCache;