UNPKG

aem-mcp-server

Version:
2 lines (1 loc) 991 B
"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"}},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,n){return Object.values(n.contentPaths).some(e=>t.startsWith(e))}export function isValidLocale(t,n){if(!t)return!1;const o=t.toLowerCase();return n.validation.allowedLocales.some(e=>e.toLowerCase()===o||o==="en"&&e.toLowerCase().startsWith("en"))}