UNPKG

bc-webclient-mcp

Version:

Model Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central via WebUI protocol. Enables AI assistants to interact with BC through the web client protocol, supporting Card, List, and Document pages with full line item support and server

42 lines 1.27 kB
/** * FormState management types for Business Central forms * * These types support the LoadForm → Parse → Index → Resolve flow * required for field name-based addressing in CRUD operations. */ /** * Normalize string for case-insensitive, accent-insensitive comparison */ export function normalizeKey(s) { if (!s) return ''; return s .trim() .toLowerCase() .normalize('NFKD') // Decompose accents .replace(/[\u0300-\u036f]/g, ''); // Remove combining marks } /** * Parse scoped field key (e.g., "Group > Field" or "Group/Field") */ export function parseScopedKey(key) { const delimiters = [' > ', '>', ' / ', '/']; for (const delimiter of delimiters) { if (key.includes(delimiter)) { const parts = key.split(delimiter).map(p => p.trim()).filter(Boolean); return { scoped: true, parts }; } } return { scoped: false, parts: [key.trim()] }; } /** * Check if a key uses sourceExpression override syntax ([SourceExpr]) */ export function isSourceExprKey(key) { const match = key.match(/^\[(.+)\]$/); if (match) { return { isSourceExpr: true, expr: match[1] }; } return { isSourceExpr: false }; } //# sourceMappingURL=form-state.js.map