aem-mcp-server
Version:
AEM MCP server. Chat with your AEM instance for content, component, and asset operations.
2 lines (1 loc) • 1.01 kB
JavaScript
;const o=new Set(["jcr:created","jcr:createdBy","jcr:lastModified","jcr:lastModifiedBy","jcr:uuid","jcr:baseVersion","jcr:predecessors","jcr:versionHistory","jcr:isCheckedOut","jcr:mixinTypes","cq:lastRolledout","cq:lastRolledoutBy","cq:lastReplicatedBy","cq:lastReplicationAction","cq:lastModified","cq:lastModifiedBy","rep:policy"]),l=new Set(["jcr:primaryType","jcr:title","jcr:description"]),a=new Set(["jcr:primaryType","sling:resourceType","jcr:title","cq:template"]);export function filterProperties(i,c="standard"){if(c==="full")return i;const t={};for(const[r,e]of Object.entries(i))l.has(r)?t[r]=e:c==="summary"?a.has(r)&&(t[r]=e):o.has(r)||(t[r]=typeof e=="string"&&e.length>500?e.substring(0,500)+"...[truncated, use getNodeContent for full]":e);return t}export function filterNodeTree(i,c="standard",t=0,r=3){if(c==="full")return i;const e=filterProperties(i,c);for(const[s,n]of Object.entries(e))n&&typeof n=="object"&&!Array.isArray(n)&&t<r&&(e[s]=filterNodeTree(n,c,t+1,r));return e}