aem-mcp-server 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,51 +1 @@
1
- "use strict";
2
- export function getAEMConfig(config) {
3
- return {
4
- contentPaths: {
5
- sitesRoot: "/content",
6
- assetsRoot: "/content/dam",
7
- templatesRoot: "/conf",
8
- experienceFragmentsRoot: "/content/experience-fragments"
9
- },
10
- replication: {
11
- publisherUrls: config.AEM_PUBLISHER_URLS?.split(",") || ["http://localhost:4503"],
12
- defaultReplicationAgent: "publish"
13
- },
14
- components: {
15
- allowedTypes: config.AEM_ALLOWED_COMPONENTS?.split(",") || [
16
- "text",
17
- "image",
18
- "hero",
19
- "button",
20
- "list",
21
- "teaser",
22
- "carousel"
23
- ],
24
- defaultProperties: {
25
- "jcr:primaryType": "nt:unstructured",
26
- "sling:resourceType": "foundation/components/text"
27
- }
28
- },
29
- queries: {
30
- maxLimit: parseInt(config.AEM_QUERY_MAX_LIMIT || "100"),
31
- defaultLimit: parseInt(config.AEM_QUERY_DEFAULT_LIMIT || "20"),
32
- timeoutMs: parseInt(config.AEM_QUERY_TIMEOUT || "30000")
33
- },
34
- validation: {
35
- maxDepth: parseInt(config.AEM_MAX_DEPTH || "5"),
36
- allowedLocales: ["en"]
37
- }
38
- };
39
- }
40
- export function isValidContentPath(path, config) {
41
- const allowedRoots = Object.values(config.contentPaths);
42
- return allowedRoots.some((root) => path.startsWith(root));
43
- }
44
- export function isValidComponentType(componentType, config) {
45
- return config.components.allowedTypes.includes(componentType);
46
- }
47
- export function isValidLocale(locale, config) {
48
- if (!locale) return false;
49
- const normalized = locale.toLowerCase();
50
- return config.validation.allowedLocales.some((l) => l.toLowerCase() === normalized || normalized === "en" && l.toLowerCase().startsWith("en"));
51
- }
1
+ "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:{allowedTypes:t.AEM_ALLOWED_COMPONENTS?.split(",")||["text","image","hero","button","list","teaser","carousel"],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:["en"]}}}export function isValidContentPath(t,e){return Object.values(e.contentPaths).some(n=>t.startsWith(n))}export function isValidComponentType(t,e){return e.components.allowedTypes.includes(t)}export function isValidLocale(t,e){if(!t)return!1;const o=t.toLowerCase();return e.validation.allowedLocales.some(n=>n.toLowerCase()===o||o==="en"&&n.toLowerCase().startsWith("en"))}