@antonytm/mcp-sitecore-server 0.16.0 → 0.17.0

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.
package/README.md CHANGED
@@ -72,7 +72,12 @@
72
72
  - [x] `provider-get-item-by-id`: returns an item by ID
73
73
  - [x] `provider-get-item-by-path`: returns an item by path
74
74
  - [x] `provider-get-item-by-query`: returns an item by query
75
- - [x] `provider-get-item-by-path`: returns an item by path
75
+ - [x] `provider-get-item-by-path`: returns an item by path
76
+ - [x] Presentation
77
+ - [x] `presentation-get-layout-by-id`: returns item presentation layout by ID
78
+ - [x] `presentation-get-layout-by-path`: returns item presentation layout by path
79
+ - [x] `presentation-set-layout-by-id`: sets item presentation layout by ID
80
+ - [x] `presentation-set-layout-by-path`: sets item presentation layout by path
76
81
  - [x] Indexing
77
82
  - [x] `indexing-initialize-search-index`: initializes one or more search indexes
78
83
  - [x] `indexing-get-search-index`: returns a search index
package/dist/bundle.js CHANGED
@@ -25116,9 +25116,9 @@ function initializeSearchIndexPowerShellTool(server, config) {
25116
25116
  function getSearchIndexPowerShellTool(server, config) {
25117
25117
  server.tool("indexing-get-search-index", "Get information about Sitecore search indexes. Can filter by name, database, running status, or corrupted status.", {
25118
25118
  name: stringType().optional().describe("The name of the index to retrieve information for. Supports wildcards."),
25119
- database: stringType().optional().describe("Filter indices by database name."),
25120
- running: booleanType().optional().describe("Filter to show only running indices."),
25121
- corrupted: booleanType().optional().describe("Filter to show only corrupted indices."),
25119
+ database: stringType().optional().describe("Filter indexes by database name."),
25120
+ running: booleanType().optional().describe("Filter to show only running indexes."),
25121
+ corrupted: booleanType().optional().describe("Filter to show only corrupted indexes."),
25122
25122
  }, async (params) => {
25123
25123
  const command = `Get-SearchIndex`;
25124
25124
  const options = {};
@@ -25784,6 +25784,91 @@ function getItemReferrerByPathPowerShellTool(server, config) {
25784
25784
  });
25785
25785
  }
25786
25786
 
25787
+ function getLayoutByIdPowershellTool(server, config) {
25788
+ server.tool("presentation-get-layout-by-id", "Gets item layout by Id.", {
25789
+ id: stringType().describe("The ID of the item to retrieve layout for."),
25790
+ finalLayout: booleanType()
25791
+ .optional()
25792
+ .describe("Specifies layout to be retrieved. If 'true', the final layout is retrieved, otherwise - shared layout."),
25793
+ language: stringType()
25794
+ .optional()
25795
+ .describe("Specifies the item language to retrieve layout."),
25796
+ }, async (params) => {
25797
+ const command = `Get-Layout`;
25798
+ const options = {};
25799
+ options["Id"] = params.id;
25800
+ if (params.finalLayout === true) {
25801
+ options["FinalLayout"] = "";
25802
+ }
25803
+ if (params.language) {
25804
+ options["Language"] = params.language;
25805
+ }
25806
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
25807
+ });
25808
+ }
25809
+
25810
+ function getLayoutByPathPowershellTool(server, config) {
25811
+ server.tool("presentation-get-layout-by-path", "Gets item layout by path.", {
25812
+ path: stringType().describe("The path of the item to retrieve layout for.").default("master:"),
25813
+ finalLayout: booleanType()
25814
+ .optional()
25815
+ .describe("Specifies layout to be retrieved. If 'true', the final layout is retrieved, otherwise - shared layout."),
25816
+ language: stringType()
25817
+ .optional()
25818
+ .describe("Specifies the item language to retrieve layout."),
25819
+ }, async (params) => {
25820
+ const command = `Get-Layout`;
25821
+ const options = {};
25822
+ options["Path"] = params.path;
25823
+ if (params.finalLayout === true) {
25824
+ options["FinalLayout"] = "";
25825
+ }
25826
+ if (params.language) {
25827
+ options["Language"] = params.language;
25828
+ }
25829
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
25830
+ });
25831
+ }
25832
+
25833
+ function setLayoutIdPowershellTool(server, config) {
25834
+ server.tool("presentation-set-layout-by-id", "Sets layout for an item specified by Id.", {
25835
+ itemId: stringType().describe("The Id of the item to set the layout for."),
25836
+ layoutPath: stringType().describe("The path of the layout.").default("master:"),
25837
+ layoutId: stringType().describe("The ID of the layout to set for the item."),
25838
+ language: stringType().describe("The language of the item to set layout for.").optional(),
25839
+ finalLayout: booleanType()
25840
+ .describe("Specifies layout to be updated. If 'true', the final layout is set, otherwise - shared layout.")
25841
+ .optional(),
25842
+ }, async (params) => {
25843
+ const command = `
25844
+ $layout = Get-Item -Path ${params.layoutPath} -Id ${params.layoutId};
25845
+ $device = Get-LayoutDevice -Default;
25846
+ Set-Layout -Id ${params.itemId} -Layout $layout -Device $device ${params.language ? `-Language ${params.language}` : ""}
25847
+ ${params.finalLayout ? "-FinalLayout" : ""};
25848
+ `.replaceAll(/[\n]+/g, "");
25849
+ return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
25850
+ });
25851
+ }
25852
+
25853
+ function setLayoutByPathPowershellTool(server, config) {
25854
+ server.tool("presentation-set-layout-by-path", "Sets layout for an item specified by path.", {
25855
+ itemId: stringType().describe("The Id of the item to set the layout for."),
25856
+ layoutPath: stringType().describe("The path of the layout.").default("master:"),
25857
+ language: stringType().describe("The language of the item to set layout for.").optional(),
25858
+ finalLayout: booleanType()
25859
+ .describe("Specifies layout to be updated. If 'true', the final layout is set, otherwise - shared layout.")
25860
+ .optional(),
25861
+ }, async (params) => {
25862
+ const command = `
25863
+ $layout = Get-Item -Path '${params.layoutPath}';
25864
+ $device = Get-LayoutDevice -Default;
25865
+ Set-Layout -Id ${params.itemId} -Layout $layout -Device $device ${params.language ? `-Language ${params.language}` : ""}
25866
+ ${params.finalLayout ? "-FinalLayout" : ""};
25867
+ `.replaceAll(/[\n]+/g, "");
25868
+ return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
25869
+ });
25870
+ }
25871
+
25787
25872
  var LogLevel;
25788
25873
  (function (LogLevel) {
25789
25874
  LogLevel["DEBUG"] = "DEBUG";
@@ -25973,6 +26058,13 @@ async function registerAll(server, config) {
25973
26058
  getItemReferenceByPathPowerShellTool,
25974
26059
  getItemReferrerByIdPowerShellTool,
25975
26060
  getItemReferrerByPathPowerShellTool,
26061
+ //Layout
26062
+ //Simple Layout PowerShell Tools
26063
+ getLayoutByIdPowershellTool,
26064
+ getLayoutByPathPowershellTool,
26065
+ //Composite Layout PowerShell Tools
26066
+ setLayoutIdPowershellTool,
26067
+ setLayoutByPathPowershellTool,
25976
26068
  //Logging
25977
26069
  getLogsPowerShellTool,
25978
26070
  //Provider
package/dist/register.js CHANGED
@@ -64,6 +64,10 @@ import { getItemReferenceByIdPowerShellTool } from "./tools/powershell/simple/co
64
64
  import { getItemReferenceByPathPowerShellTool } from "./tools/powershell/simple/common/get-item-reference-by-path.js";
65
65
  import { getItemReferrerByIdPowerShellTool } from "./tools/powershell/simple/common/get-item-referrer-by-id.js";
66
66
  import { getItemReferrerByPathPowerShellTool } from "./tools/powershell/simple/common/get-item-referrer-by-path.js";
67
+ import { getLayoutByIdPowershellTool } from "./tools/powershell/simple/presentation/get-layout-by-id.js";
68
+ import { getLayoutByPathPowershellTool } from "./tools/powershell/simple/presentation/get-layout-by-path.js";
69
+ import { setLayoutIdPowershellTool } from "./tools/powershell/composite/presentation/set-layout-by-id.js";
70
+ import { setLayoutByPathPowershellTool } from "./tools/powershell/composite/presentation/set-layout-by-path.js";
67
71
  import { getLogsPowerShellTool } from "./tools/powershell/composite/logging/get-logs.js";
68
72
  export async function register(array, server, config) {
69
73
  for (const register of array) {
@@ -136,6 +140,13 @@ export async function registerAll(server, config) {
136
140
  getItemReferenceByPathPowerShellTool,
137
141
  getItemReferrerByIdPowerShellTool,
138
142
  getItemReferrerByPathPowerShellTool,
143
+ //Layout
144
+ //Simple Layout PowerShell Tools
145
+ getLayoutByIdPowershellTool,
146
+ getLayoutByPathPowershellTool,
147
+ //Composite Layout PowerShell Tools
148
+ setLayoutIdPowershellTool,
149
+ setLayoutByPathPowershellTool,
139
150
  //Logging
140
151
  getLogsPowerShellTool,
141
152
  //Provider
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAA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AC5B,8BAA8B;QAC9B,yBAAyB;QACzB,wCAAwC;QACxC,yBAAyB;QACzB,sBAAsB;QACtB,iCAAiC;QACjC,mCAAmC;QACnC,kCAAkC;QAClC,oCAAoC;QACpC,iCAAiC;QACjC,mCAAmC;QAGnC,QAAQ;QACR,gCAAgC;QAChC,2BAA2B;QAC3B,6BAA6B;QAC7B,mCAAmC;QACnC,yBAAyB;QACzB,6BAA6B;QAE7B,SAAS;QACT,qBAAqB;QAGrB,UAAU;QACV,qBAAqB;QACrB,2BAA2B;QAC3B,mCAAmC;QACnC,4BAA4B;QAC5B,sBAAsB;QACtB,+BAA+B;QAC/B,gCAAgC;QAChC,6BAA6B;QAC7B,qCAAqC;QACrC,8CAA8C;QAC9C,gDAAgD;QAChD,uCAAuC;QACvC,yCAAyC;KAE5C,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function setLayoutIdPowershellTool(server: McpServer, config: Config): void;
@@ -0,0 +1,24 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../../simple/generic.js";
4
+ export function setLayoutIdPowershellTool(server, config) {
5
+ server.tool("presentation-set-layout-by-id", "Sets layout for an item specified by Id.", {
6
+ itemId: z.string().describe("The Id of the item to set the layout for."),
7
+ layoutPath: z.string().describe("The path of the layout.").default("master:"),
8
+ layoutId: z.string().describe("The ID of the layout to set for the item."),
9
+ language: z.string().describe("The language of the item to set layout for.").optional(),
10
+ finalLayout: z
11
+ .boolean()
12
+ .describe("Specifies layout to be updated. If 'true', the final layout is set, otherwise - shared layout.")
13
+ .optional(),
14
+ }, async (params) => {
15
+ const command = `
16
+ $layout = Get-Item -Path ${params.layoutPath} -Id ${params.layoutId};
17
+ $device = Get-LayoutDevice -Default;
18
+ Set-Layout -Id ${params.itemId} -Layout $layout -Device $device ${params.language ? `-Language ${params.language}` : ""}
19
+ ${params.finalLayout ? "-FinalLayout" : ""};
20
+ `.replaceAll(/[\n]+/g, "");
21
+ return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
22
+ });
23
+ }
24
+ //# sourceMappingURL=set-layout-by-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-layout-by-id.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/composite/presentation/set-layout-by-id.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAc;IACvE,MAAM,CAAC,IAAI,CACP,+BAA+B,EAC/B,0CAA0C,EAC1C;QACI,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QACxE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QAC1E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC,CAAC,QAAQ,EAAE;QACvF,WAAW,EAAE,CAAC;aACT,OAAO,EAAE;aACT,QAAQ,CAAC,gGAAgG,CAAC;aAC1G,QAAQ,EAAE;KAClB,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG;2CACe,MAAM,CAAC,UAAU,QAAQ,MAAM,CAAC,QAAQ;;iCAElD,MAAM,CAAC,MAAM,oCAAoC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;sBACjH,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;aACjD,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE3B,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function setLayoutByPathPowershellTool(server: McpServer, config: Config): void;
@@ -0,0 +1,23 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../../simple/generic.js";
4
+ export function setLayoutByPathPowershellTool(server, config) {
5
+ server.tool("presentation-set-layout-by-path", "Sets layout for an item specified by path.", {
6
+ itemId: z.string().describe("The Id of the item to set the layout for."),
7
+ layoutPath: z.string().describe("The path of the layout.").default("master:"),
8
+ language: z.string().describe("The language of the item to set layout for.").optional(),
9
+ finalLayout: z
10
+ .boolean()
11
+ .describe("Specifies layout to be updated. If 'true', the final layout is set, otherwise - shared layout.")
12
+ .optional(),
13
+ }, async (params) => {
14
+ const command = `
15
+ $layout = Get-Item -Path '${params.layoutPath}';
16
+ $device = Get-LayoutDevice -Default;
17
+ Set-Layout -Id ${params.itemId} -Layout $layout -Device $device ${params.language ? `-Language ${params.language}` : ""}
18
+ ${params.finalLayout ? "-FinalLayout" : ""};
19
+ `.replaceAll(/[\n]+/g, "");
20
+ return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
21
+ });
22
+ }
23
+ //# sourceMappingURL=set-layout-by-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-layout-by-path.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/composite/presentation/set-layout-by-path.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAEtE,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAc;IAC3E,MAAM,CAAC,IAAI,CACP,iCAAiC,EACjC,4CAA4C,EAC5C;QACI,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;QACxE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC7E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC,CAAC,QAAQ,EAAE;QACvF,WAAW,EAAE,CAAC;aACT,OAAO,EAAE;aACT,QAAQ,CAAC,gGAAgG,CAAC;aAC1G,QAAQ,EAAE;KAClB,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG;4CACgB,MAAM,CAAC,UAAU;;iCAE5B,MAAM,CAAC,MAAM,oCAAoC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;sBACjH,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE;aACjD,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QAE3B,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC,CACJ,CAAC;AACN,CAAC"}
@@ -4,9 +4,9 @@ import { runGenericPowershellCommand } from "../generic.js";
4
4
  export function getSearchIndexPowerShellTool(server, config) {
5
5
  server.tool("indexing-get-search-index", "Get information about Sitecore search indexes. Can filter by name, database, running status, or corrupted status.", {
6
6
  name: z.string().optional().describe("The name of the index to retrieve information for. Supports wildcards."),
7
- database: z.string().optional().describe("Filter indices by database name."),
8
- running: z.boolean().optional().describe("Filter to show only running indices."),
9
- corrupted: z.boolean().optional().describe("Filter to show only corrupted indices."),
7
+ database: z.string().optional().describe("Filter indexes by database name."),
8
+ running: z.boolean().optional().describe("Filter to show only running indexes."),
9
+ corrupted: z.boolean().optional().describe("Filter to show only corrupted indexes."),
10
10
  }, async (params) => {
11
11
  const command = `Get-SearchIndex`;
12
12
  const options = {};
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function getLayoutByIdPowershellTool(server: McpServer, config: Config): void;
@@ -0,0 +1,28 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function getLayoutByIdPowershellTool(server, config) {
5
+ server.tool("presentation-get-layout-by-id", "Gets item layout by Id.", {
6
+ id: z.string().describe("The ID of the item to retrieve layout for."),
7
+ finalLayout: z
8
+ .boolean()
9
+ .optional()
10
+ .describe("Specifies layout to be retrieved. If 'true', the final layout is retrieved, otherwise - shared layout."),
11
+ language: z.string()
12
+ .optional()
13
+ .describe("Specifies the item language to retrieve layout."),
14
+ }, async (params) => {
15
+ const command = `Get-Layout`;
16
+ const options = {};
17
+ options["Id"] = params.id;
18
+ if (params.finalLayout === true) {
19
+ options["FinalLayout"] = "";
20
+ }
21
+ if (params.language) {
22
+ options["Language"] = params.language;
23
+ }
24
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
25
+ });
26
+ }
27
+ ;
28
+ //# sourceMappingURL=get-layout-by-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-layout-by-id.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/presentation/get-layout-by-id.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAc;IACzE,MAAM,CAAC,IAAI,CACP,+BAA+B,EAC/B,yBAAyB,EACzB;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4CAA4C,CAAC;QACrE,WAAW,EAAE,CAAC;aACT,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,wGAAwG,CAAC;QACvH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,EAAE;aACV,QAAQ,CAAC,iDAAiD,CAAC;KACnE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,YAAY,CAAC;QAC7B,MAAM,OAAO,GAAwB,EAAE,CAAC;QAExC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC;QAE1B,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,EAC/B,CAAC;YACG,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QAChC,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EACnB,CAAC;YACG,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC;AAAA,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp";
2
+ import type { Config } from "../../../../config.js";
3
+ export declare function getLayoutByPathPowershellTool(server: McpServer, config: Config): void;
@@ -0,0 +1,27 @@
1
+ import { z } from "zod";
2
+ import { safeMcpResponse } from "../../../../helper.js";
3
+ import { runGenericPowershellCommand } from "../generic.js";
4
+ export function getLayoutByPathPowershellTool(server, config) {
5
+ server.tool("presentation-get-layout-by-path", "Gets item layout by path.", {
6
+ path: z.string().describe("The path of the item to retrieve layout for.").default("master:"),
7
+ finalLayout: z
8
+ .boolean()
9
+ .optional()
10
+ .describe("Specifies layout to be retrieved. If 'true', the final layout is retrieved, otherwise - shared layout."),
11
+ language: z.string()
12
+ .optional()
13
+ .describe("Specifies the item language to retrieve layout."),
14
+ }, async (params) => {
15
+ const command = `Get-Layout`;
16
+ const options = {};
17
+ options["Path"] = params.path;
18
+ if (params.finalLayout === true) {
19
+ options["FinalLayout"] = "";
20
+ }
21
+ if (params.language) {
22
+ options["Language"] = params.language;
23
+ }
24
+ return safeMcpResponse(runGenericPowershellCommand(config, command, options));
25
+ });
26
+ }
27
+ //# sourceMappingURL=get-layout-by-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-layout-by-path.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/presentation/get-layout-by-path.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAc;IAC3E,MAAM,CAAC,IAAI,CACP,iCAAiC,EACjC,2BAA2B,EAC3B;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC5F,WAAW,EAAE,CAAC;aACT,OAAO,EAAE;aACT,QAAQ,EAAE;aACV,QAAQ,CAAC,wGAAwG,CAAC;QACvH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,EAAE;aACV,QAAQ,CAAC,iDAAiD,CAAC;KACnE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,YAAY,CAAC;QAC7B,MAAM,OAAO,GAAwB,EAAE,CAAC;QAExC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;QAE9B,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,EAC/B,CAAC;YACG,OAAO,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QAChC,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EACnB,CAAC;YACG,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antonytm/mcp-sitecore-server",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "A Model Context Protocol server for Sitecore",
5
5
  "files": [
6
6
  "dist",