UNPKG

aem-mcp-server

Version:

AEM MCP server. Chat with your AEM instance for content, component, and asset operations.

2 lines (1 loc) 1.05 kB
"use strict";export function getAEMConfig(t){return{contentPaths:{sitesRoot:"/content",assetsRoot:"/content/dam",templatesRoot:"/conf",experienceFragmentsRoot:"/content/experience-fragments"},replication:{publisherUrls:t.AEM_PUBLISHER_URLS?.split(",")||["http://localhost:4503"],defaultReplicationAgent:"publish"},components:{defaultProperties:{"jcr:primaryType":"nt:unstructured","sling:resourceType":"foundation/components/text"},componentPaths:{projectRoot1:"/apps/aemmcp/base/components"}},queries:{maxLimit:parseInt(t.AEM_QUERY_MAX_LIMIT||"100"),defaultLimit:parseInt(t.AEM_QUERY_DEFAULT_LIMIT||"20"),timeoutMs:parseInt(t.AEM_QUERY_TIMEOUT||"30000")},validation:{maxDepth:parseInt(t.AEM_MAX_DEPTH||"5"),allowedLocales:t.AEM_ALLOWED_LOCALES?.split(",")||["en"]}}}export function isValidContentPath(t,o){return Object.values(o.contentPaths).some(e=>t.startsWith(e))}export function isValidLocale(t,o){if(!t)return!1;const n=t.toLowerCase();return o.validation.allowedLocales.some(e=>e.toLowerCase()===n||n==="en"&&e.toLowerCase().startsWith("en"))}