@antonytm/mcp-sitecore-server 0.10.6 → 0.12.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 +8 -1
- package/dist/bundle.js +358 -201
- package/dist/register.js +62 -32
- package/dist/register.js.map +1 -1
- package/dist/tools/item-service/{composite → logic/composite}/get-item-descendants.d.ts +1 -1
- package/dist/tools/item-service/{composite → logic/composite}/get-item-descendants.js +2 -2
- package/dist/tools/item-service/logic/composite/get-item-descendants.js.map +1 -0
- package/dist/tools/item-service/{composite → logic/composite}/get-languages.d.ts +1 -1
- package/dist/tools/item-service/{composite → logic/composite}/get-languages.js +2 -2
- package/dist/tools/item-service/logic/composite/get-languages.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/create-item.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/create-item.js +2 -2
- package/dist/tools/item-service/logic/simple/create-item.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/delete-item.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/delete-item.js +2 -2
- package/dist/tools/item-service/logic/simple/delete-item.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/edit-item.js +1 -1
- package/dist/tools/item-service/logic/simple/edit-item.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/get-item-by-path.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/get-item-by-path.js +2 -2
- package/dist/tools/item-service/logic/simple/get-item-by-path.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/get-item-children.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/get-item-children.js +2 -2
- package/dist/tools/item-service/logic/simple/get-item-children.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/get-item.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/get-item.js +2 -2
- package/dist/tools/item-service/logic/simple/get-item.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/run-stored-query.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/run-stored-query.js +2 -2
- package/dist/tools/item-service/logic/simple/run-stored-query.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/run-stored-search.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/run-stored-search.js +2 -2
- package/dist/tools/item-service/logic/simple/run-stored-search.js.map +1 -0
- package/dist/tools/item-service/{simple → logic/simple}/search-items.d.ts +1 -1
- package/dist/tools/item-service/{simple → logic/simple}/search-items.js +2 -2
- package/dist/tools/item-service/logic/simple/search-items.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/composite/get-item-descendants.registration.js → tools/composite/get-item-descendants.js} +2 -2
- package/dist/tools/item-service/tools/composite/get-item-descendants.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/composite/get-languages.registration.js → tools/composite/get-languages.js} +2 -2
- package/dist/tools/item-service/tools/composite/get-languages.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/create-item.registration.js → tools/simple/create-item.js} +2 -2
- package/dist/tools/item-service/tools/simple/create-item.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/delete-item.registration.js → tools/simple/delete-item.js} +2 -2
- package/dist/tools/item-service/tools/simple/delete-item.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/edit-item.registration.js → tools/simple/edit-item.js} +2 -2
- package/dist/tools/item-service/tools/simple/edit-item.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/get-item-by-path.registration.js → tools/simple/get-item-by-path.js} +2 -2
- package/dist/tools/item-service/tools/simple/get-item-by-path.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/get-item-children.registration.js → tools/simple/get-item-children.js} +2 -2
- package/dist/tools/item-service/tools/simple/get-item-children.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/get-item.registration.js → tools/simple/get-item.js} +2 -2
- package/dist/tools/item-service/tools/simple/get-item.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/run-stored-query.registration.js → tools/simple/run-stored-query.js} +2 -2
- package/dist/tools/item-service/tools/simple/run-stored-query.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/run-stored-search.registration.js → tools/simple/run-stored-search.js} +2 -2
- package/dist/tools/item-service/tools/simple/run-stored-search.js.map +1 -0
- package/dist/tools/item-service/{tool-registrations/simple/search-items.registration.js → tools/simple/search-items.js} +2 -2
- package/dist/tools/item-service/tools/simple/search-items.js.map +1 -0
- package/dist/tools/powershell/client.js +1 -1
- package/dist/tools/powershell/client.js.map +1 -1
- package/dist/tools/powershell/composite/indexing/initialialize-search-indexing-item-by-id.d.ts +3 -0
- package/dist/tools/powershell/composite/indexing/initialialize-search-indexing-item-by-id.js +24 -0
- package/dist/tools/powershell/composite/indexing/initialialize-search-indexing-item-by-id.js.map +1 -0
- package/dist/tools/powershell/composite/indexing/initialialize-search-indexing-item-by-path.d.ts +3 -0
- package/dist/tools/powershell/composite/indexing/initialialize-search-indexing-item-by-path.js +21 -0
- package/dist/tools/powershell/composite/indexing/initialialize-search-indexing-item-by-path.js.map +1 -0
- package/dist/tools/powershell/composite/indexing/remove-search-index-item-by-id.d.ts +3 -0
- package/dist/tools/powershell/composite/indexing/remove-search-index-item-by-id.js +24 -0
- package/dist/tools/powershell/composite/indexing/remove-search-index-item-by-id.js.map +1 -0
- package/dist/tools/powershell/composite/indexing/remove-search-index-item-by-path.d.ts +3 -0
- package/dist/tools/powershell/composite/indexing/remove-search-index-item-by-path.js +21 -0
- package/dist/tools/powershell/composite/indexing/remove-search-index-item-by-path.js.map +1 -0
- package/dist/tools/powershell/{simple/security/get-domain.d.ts → composite/security/set-item-acl-by-id.d.ts} +1 -1
- package/dist/tools/powershell/composite/security/set-item-acl-by-id.js +35 -0
- package/dist/tools/powershell/composite/security/set-item-acl-by-id.js.map +1 -0
- package/dist/tools/powershell/composite/security/set-item-acl-by-path.d.ts +3 -0
- package/dist/tools/powershell/composite/security/set-item-acl-by-path.js +32 -0
- package/dist/tools/powershell/composite/security/set-item-acl-by-path.js.map +1 -0
- package/dist/tools/powershell/simple/indexing/resume-search-index.d.ts +3 -0
- package/dist/tools/powershell/simple/indexing/resume-search-index.js +16 -0
- package/dist/tools/powershell/simple/indexing/resume-search-index.js.map +1 -0
- package/dist/tools/powershell/simple/indexing/stop-search-index.d.ts +3 -0
- package/dist/tools/powershell/simple/indexing/stop-search-index.js +16 -0
- package/dist/tools/powershell/simple/indexing/stop-search-index.js.map +1 -0
- package/dist/tools/powershell/simple/indexing/suspend-search-index.d.ts +3 -0
- package/dist/tools/powershell/simple/indexing/suspend-search-index.js +16 -0
- package/dist/tools/powershell/simple/indexing/suspend-search-index.js.map +1 -0
- package/dist/tools/powershell/simple/security/{unprotect-item.d.ts → get-all-domains.d.ts} +1 -1
- package/dist/tools/powershell/simple/security/get-all-domains.js +10 -0
- package/dist/tools/powershell/simple/security/get-all-domains.js.map +1 -0
- package/dist/tools/powershell/simple/security/{get-role.d.ts → get-current-user.d.ts} +1 -1
- package/dist/tools/powershell/simple/security/get-current-user.js +12 -0
- package/dist/tools/powershell/simple/security/get-current-user.js.map +1 -0
- package/dist/tools/powershell/simple/security/get-domain-by-name.d.ts +3 -0
- package/dist/tools/powershell/simple/security/{get-domain.js → get-domain-by-name.js} +2 -7
- package/dist/tools/powershell/simple/security/get-domain-by-name.js.map +1 -0
- package/dist/tools/powershell/simple/security/get-role-by-filter.d.ts +3 -0
- package/dist/tools/powershell/simple/security/{get-role.js → get-role-by-filter.js} +2 -11
- package/dist/tools/powershell/simple/security/get-role-by-filter.js.map +1 -0
- package/dist/tools/powershell/simple/security/get-role-by-identity.d.ts +3 -0
- package/dist/tools/powershell/simple/security/get-role-by-identity.js +15 -0
- package/dist/tools/powershell/simple/security/get-role-by-identity.js.map +1 -0
- package/dist/tools/powershell/simple/security/get-user-by-filter.d.ts +3 -0
- package/dist/tools/powershell/simple/security/get-user-by-filter.js +15 -0
- package/dist/tools/powershell/simple/security/get-user-by-filter.js.map +1 -0
- package/dist/tools/powershell/simple/security/get-user-by-identity.d.ts +3 -0
- package/dist/tools/powershell/simple/security/get-user-by-identity.js +15 -0
- package/dist/tools/powershell/simple/security/get-user-by-identity.js.map +1 -0
- package/dist/tools/powershell/{composite/security/set-item-acl.d.ts → simple/security/lock-item-by-id.d.ts} +1 -1
- package/dist/tools/powershell/simple/security/lock-item-by-id.js +31 -0
- package/dist/tools/powershell/simple/security/lock-item-by-id.js.map +1 -0
- package/dist/tools/powershell/simple/security/{get-user.d.ts → lock-item-by-path.d.ts} +1 -1
- package/dist/tools/powershell/simple/security/{lock-item.js → lock-item-by-path.js} +2 -27
- package/dist/tools/powershell/simple/security/lock-item-by-path.js.map +1 -0
- package/dist/tools/powershell/simple/security/protect-item-by-id.d.ts +3 -0
- package/dist/tools/powershell/simple/security/protect-item-by-id.js +26 -0
- package/dist/tools/powershell/simple/security/protect-item-by-id.js.map +1 -0
- package/dist/tools/powershell/simple/security/protect-item-by-path.d.ts +3 -0
- package/dist/tools/powershell/simple/security/{protect-item.js → protect-item-by-path.js} +2 -22
- package/dist/tools/powershell/simple/security/protect-item-by-path.js.map +1 -0
- package/dist/tools/powershell/simple/security/unprotect-item-by-id.d.ts +3 -0
- package/dist/tools/powershell/simple/security/unprotect-item-by-id.js +26 -0
- package/dist/tools/powershell/simple/security/unprotect-item-by-id.js.map +1 -0
- package/dist/tools/powershell/simple/security/unprotect-item-by-path.d.ts +3 -0
- package/dist/tools/powershell/simple/security/{unprotect-item.js → unprotect-item-by-path.js} +2 -22
- package/dist/tools/powershell/simple/security/unprotect-item-by-path.js.map +1 -0
- package/package.json +1 -1
- package/dist/tools/item-service/composite/get-item-descendants.js.map +0 -1
- package/dist/tools/item-service/composite/get-languages.js.map +0 -1
- package/dist/tools/item-service/simple/create-item.js.map +0 -1
- package/dist/tools/item-service/simple/delete-item.js.map +0 -1
- package/dist/tools/item-service/simple/edit-item.js.map +0 -1
- package/dist/tools/item-service/simple/get-item-by-path.js.map +0 -1
- package/dist/tools/item-service/simple/get-item-children.js.map +0 -1
- package/dist/tools/item-service/simple/get-item.js.map +0 -1
- package/dist/tools/item-service/simple/run-stored-query.js.map +0 -1
- package/dist/tools/item-service/simple/run-stored-search.js.map +0 -1
- package/dist/tools/item-service/simple/search-items.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/composite/get-item-descendants.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/composite/get-languages.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/create-item.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/delete-item.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/edit-item.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/get-item-by-path.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/get-item-children.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/get-item.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/run-stored-query.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/run-stored-search.registration.js.map +0 -1
- package/dist/tools/item-service/tool-registrations/simple/search-items.registration.js.map +0 -1
- package/dist/tools/powershell/composite/security/set-item-acl.js +0 -59
- package/dist/tools/powershell/composite/security/set-item-acl.js.map +0 -1
- package/dist/tools/powershell/simple/media/media-management.d.ts +0 -0
- package/dist/tools/powershell/simple/media/media-management.js +0 -2
- package/dist/tools/powershell/simple/media/media-management.js.map +0 -1
- package/dist/tools/powershell/simple/packages/package-management.d.ts +0 -0
- package/dist/tools/powershell/simple/packages/package-management.js +0 -2
- package/dist/tools/powershell/simple/packages/package-management.js.map +0 -1
- package/dist/tools/powershell/simple/security/get-domain.js.map +0 -1
- package/dist/tools/powershell/simple/security/get-role.js.map +0 -1
- package/dist/tools/powershell/simple/security/get-user.js +0 -31
- package/dist/tools/powershell/simple/security/get-user.js.map +0 -1
- package/dist/tools/powershell/simple/security/lock-item.d.ts +0 -3
- package/dist/tools/powershell/simple/security/lock-item.js.map +0 -1
- package/dist/tools/powershell/simple/security/protect-item.d.ts +0 -3
- package/dist/tools/powershell/simple/security/protect-item.js.map +0 -1
- package/dist/tools/powershell/simple/security/unprotect-item.js.map +0 -1
- /package/dist/tools/item-service/{simple → logic/simple}/edit-item.d.ts +0 -0
- /package/dist/tools/item-service/{tool-registrations/composite/get-item-descendants.registration.d.ts → tools/composite/get-item-descendants.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/composite/get-languages.registration.d.ts → tools/composite/get-languages.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/create-item.registration.d.ts → tools/simple/create-item.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/delete-item.registration.d.ts → tools/simple/delete-item.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/edit-item.registration.d.ts → tools/simple/edit-item.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/get-item-by-path.registration.d.ts → tools/simple/get-item-by-path.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/get-item-children.registration.d.ts → tools/simple/get-item-children.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/get-item.registration.d.ts → tools/simple/get-item.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/run-stored-query.registration.d.ts → tools/simple/run-stored-query.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/run-stored-search.registration.d.ts → tools/simple/run-stored-search.d.ts} +0 -0
- /package/dist/tools/item-service/{tool-registrations/simple/search-items.registration.d.ts → tools/simple/search-items.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -76,7 +76,14 @@
|
|
|
76
76
|
- [x] Indexing
|
|
77
77
|
- [x] `indexing-initialize-search-index`: initializes one or more search indexes
|
|
78
78
|
- [x] `indexing-get-search-index`: returns a search index
|
|
79
|
-
- [x] `indexing-find-item`: finds an item in a search index
|
|
79
|
+
- [x] `indexing-find-item`: finds an item in a search index - [x] `indexing-suspend-search-index`: suspends one or more running search indexes
|
|
80
|
+
- [x] `indexing-stop-search-index`: stops one or more running search indexes
|
|
81
|
+
- [x] `indexing-resume-search-index`: resumes one or more paused search indexes
|
|
82
|
+
- [x] `indexing-initialize-search-index-item-by-id`: rebuilds the index for a given tree with the specified root item by ID and index name
|
|
83
|
+
- [x] `indexing-initialize-search-index-item-by-path`: rebuilds the index for a given tree with the specified root item by path and index name
|
|
84
|
+
- [x] `indexing-remove-search-index-item-by-id`: removes the item with the specified ID from the search index
|
|
85
|
+
- [x] `indexing-remove-search-index-item-by-path`: removes the item with the specified path from the search index
|
|
86
|
+
- [ ] ~~`indexing-initialize-item`: initializes items with the PowerShell automatic properties for each field.~~ Skipped, no value for MCP server.
|
|
80
87
|
|
|
81
88
|
- [ ] Sitecore CLI
|
|
82
89
|
|
package/dist/bundle.js
CHANGED
|
@@ -24271,7 +24271,7 @@ async function runGenericPowershellCommand(config, command, options, outputForma
|
|
|
24271
24271
|
};
|
|
24272
24272
|
}
|
|
24273
24273
|
|
|
24274
|
-
function
|
|
24274
|
+
function getUserByIdentityPowerShellTool(server, config) {
|
|
24275
24275
|
server.tool("security-get-user-by-identity", "Get a Sitecore user by its name.", {
|
|
24276
24276
|
identity: stringType(),
|
|
24277
24277
|
}, async (params) => {
|
|
@@ -24281,6 +24281,9 @@ function getUserPowerShellTool(server, config) {
|
|
|
24281
24281
|
};
|
|
24282
24282
|
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24283
24283
|
});
|
|
24284
|
+
}
|
|
24285
|
+
|
|
24286
|
+
function getCurrentUserPowerShellTool(server, config) {
|
|
24284
24287
|
server.tool("security-get-current-user", "Get the current Sitecore user.", {}, async () => {
|
|
24285
24288
|
const command = `Get-User`;
|
|
24286
24289
|
const options = {
|
|
@@ -24288,6 +24291,9 @@ function getUserPowerShellTool(server, config) {
|
|
|
24288
24291
|
};
|
|
24289
24292
|
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24290
24293
|
});
|
|
24294
|
+
}
|
|
24295
|
+
|
|
24296
|
+
function getUserByFilterPowerShellTool(server, config) {
|
|
24291
24297
|
server.tool("security-get-user-by-filter", "Get a Sitecore users by filter.", {
|
|
24292
24298
|
filter: stringType(),
|
|
24293
24299
|
}, async (params) => {
|
|
@@ -24477,24 +24483,7 @@ function setUserPasswordPowerShellTool(server, config) {
|
|
|
24477
24483
|
});
|
|
24478
24484
|
}
|
|
24479
24485
|
|
|
24480
|
-
function
|
|
24481
|
-
server.tool("security-get-domain-by-name", "Get a Sitecore domain by its name.", {
|
|
24482
|
-
name: stringType(),
|
|
24483
|
-
}, async (params) => {
|
|
24484
|
-
const command = `Get-Domain`;
|
|
24485
|
-
const options = {
|
|
24486
|
-
"Name": params.name,
|
|
24487
|
-
};
|
|
24488
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24489
|
-
});
|
|
24490
|
-
server.tool("security-get-domain", "Get all Sitecore domains.", {}, async () => {
|
|
24491
|
-
const command = `Get-Domain`;
|
|
24492
|
-
const options = {};
|
|
24493
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24494
|
-
});
|
|
24495
|
-
}
|
|
24496
|
-
|
|
24497
|
-
function getRolePowerShellTool(server, config) {
|
|
24486
|
+
function getRoleByIdentityPowerShellTool(server, config) {
|
|
24498
24487
|
server.tool("security-get-role-by-identity", "Get a Sitecore role by its identity.", {
|
|
24499
24488
|
identity: stringType().describe("The identity of the role to retrieve (e.g. 'sitecore\\Author')"),
|
|
24500
24489
|
}, async (params) => {
|
|
@@ -24504,6 +24493,9 @@ function getRolePowerShellTool(server, config) {
|
|
|
24504
24493
|
};
|
|
24505
24494
|
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24506
24495
|
});
|
|
24496
|
+
}
|
|
24497
|
+
|
|
24498
|
+
function getRoleByFilterPowerShellTool(server, config) {
|
|
24507
24499
|
server.tool("security-get-role-by-filter", "Get Sitecore roles by filter criteria.", {
|
|
24508
24500
|
filter: stringType().describe("The filter criteria to search for roles (e.g. 'sitecore\\*' or '*Author*')"),
|
|
24509
24501
|
}, async (params) => {
|
|
@@ -24575,59 +24567,6 @@ function removeRoleMemberPowerShellTool(server, config) {
|
|
|
24575
24567
|
});
|
|
24576
24568
|
}
|
|
24577
24569
|
|
|
24578
|
-
function lockItemPowerShellTool(server, config) {
|
|
24579
|
-
server.tool("security-lock-item-by-path", "Lock a Sitecore item by its path.", {
|
|
24580
|
-
path: stringType()
|
|
24581
|
-
.describe("The path of the item to lock (e.g. /sitecore/content/Home)"),
|
|
24582
|
-
force: booleanType()
|
|
24583
|
-
.optional().describe("If set to true, will force the lock even if the item is locked by another user"),
|
|
24584
|
-
passThru: booleanType().optional()
|
|
24585
|
-
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
24586
|
-
database: stringType().optional()
|
|
24587
|
-
.describe("The database containing the item (defaults to the context database)")
|
|
24588
|
-
}, async (params) => {
|
|
24589
|
-
const command = `Lock-Item`;
|
|
24590
|
-
const options = {
|
|
24591
|
-
"Path": params.path,
|
|
24592
|
-
};
|
|
24593
|
-
if (params.force) {
|
|
24594
|
-
options["Force"] = "";
|
|
24595
|
-
}
|
|
24596
|
-
if (params.passThru) {
|
|
24597
|
-
options["PassThru"] = "";
|
|
24598
|
-
}
|
|
24599
|
-
if (params.database) {
|
|
24600
|
-
options["Database"] = params.database;
|
|
24601
|
-
}
|
|
24602
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24603
|
-
});
|
|
24604
|
-
server.tool("security-lock-item-by-id", "Lock a Sitecore item by its ID.", {
|
|
24605
|
-
id: stringType()
|
|
24606
|
-
.describe("The ID of the item to lock"),
|
|
24607
|
-
force: booleanType().optional()
|
|
24608
|
-
.describe("If set to true, will force the lock even if the item is locked by another user"),
|
|
24609
|
-
passThru: booleanType().optional()
|
|
24610
|
-
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
24611
|
-
database: stringType().optional()
|
|
24612
|
-
.describe("The database containing the item (defaults to the context database)")
|
|
24613
|
-
}, async (params) => {
|
|
24614
|
-
const command = `Lock-Item`;
|
|
24615
|
-
const options = {
|
|
24616
|
-
"Id": params.id,
|
|
24617
|
-
};
|
|
24618
|
-
if (params.force) {
|
|
24619
|
-
options["Force"] = "";
|
|
24620
|
-
}
|
|
24621
|
-
if (params.passThru) {
|
|
24622
|
-
options["PassThru"] = "";
|
|
24623
|
-
}
|
|
24624
|
-
if (params.database) {
|
|
24625
|
-
options["Database"] = params.database;
|
|
24626
|
-
}
|
|
24627
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24628
|
-
});
|
|
24629
|
-
}
|
|
24630
|
-
|
|
24631
24570
|
function unlockItemPowerShellTool(server, config) {
|
|
24632
24571
|
server.tool("security-unlock-item-by-id", "Unlocks a Sitecore item by its ID.", {
|
|
24633
24572
|
id: stringType().describe("The ID of the item to unlock"),
|
|
@@ -24677,7 +24616,7 @@ function unlockItemPowerShellTool(server, config) {
|
|
|
24677
24616
|
});
|
|
24678
24617
|
}
|
|
24679
24618
|
|
|
24680
|
-
function
|
|
24619
|
+
function protectItemByPathPowerShellTool(server, config) {
|
|
24681
24620
|
server.tool("security-protect-item-by-path", "Protect a Sitecore item by its path.", {
|
|
24682
24621
|
path: stringType()
|
|
24683
24622
|
.describe("The path of the item to protect (e.g. /sitecore/content/Home)"),
|
|
@@ -24698,6 +24637,9 @@ function protectItemPowerShellTool(server, config) {
|
|
|
24698
24637
|
}
|
|
24699
24638
|
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24700
24639
|
});
|
|
24640
|
+
}
|
|
24641
|
+
|
|
24642
|
+
function protectItemByIdPowerShellTool(server, config) {
|
|
24701
24643
|
server.tool("security-protect-item-by-id", "Protect a Sitecore item by its ID.", {
|
|
24702
24644
|
id: stringType()
|
|
24703
24645
|
.describe("The ID of the item to protect"),
|
|
@@ -24720,49 +24662,6 @@ function protectItemPowerShellTool(server, config) {
|
|
|
24720
24662
|
});
|
|
24721
24663
|
}
|
|
24722
24664
|
|
|
24723
|
-
function unprotectItemPowerShellTool(server, config) {
|
|
24724
|
-
server.tool("security-unprotect-item-by-path", "Unprotect a Sitecore item by its path.", {
|
|
24725
|
-
path: stringType()
|
|
24726
|
-
.describe("The path of the item to unprotect (e.g. /sitecore/content/Home)"),
|
|
24727
|
-
passThru: booleanType().optional()
|
|
24728
|
-
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
24729
|
-
database: stringType().optional()
|
|
24730
|
-
.describe("The database containing the item (defaults to the context database)")
|
|
24731
|
-
}, async (params) => {
|
|
24732
|
-
const command = `Unprotect-Item`;
|
|
24733
|
-
const options = {
|
|
24734
|
-
"Path": params.path,
|
|
24735
|
-
};
|
|
24736
|
-
if (params.passThru) {
|
|
24737
|
-
options["PassThru"] = "";
|
|
24738
|
-
}
|
|
24739
|
-
if (params.database) {
|
|
24740
|
-
options["Database"] = params.database;
|
|
24741
|
-
}
|
|
24742
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24743
|
-
});
|
|
24744
|
-
server.tool("security-unprotect-item-by-id", "Unprotect a Sitecore item by its ID.", {
|
|
24745
|
-
id: stringType()
|
|
24746
|
-
.describe("The ID of the item to unprotect"),
|
|
24747
|
-
passThru: booleanType().optional()
|
|
24748
|
-
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
24749
|
-
database: stringType().optional()
|
|
24750
|
-
.describe("The database containing the item (defaults to the context database)")
|
|
24751
|
-
}, async (params) => {
|
|
24752
|
-
const command = `Unprotect-Item`;
|
|
24753
|
-
const options = {
|
|
24754
|
-
"Id": params.id,
|
|
24755
|
-
};
|
|
24756
|
-
if (params.passThru) {
|
|
24757
|
-
options["PassThru"] = "";
|
|
24758
|
-
}
|
|
24759
|
-
if (params.database) {
|
|
24760
|
-
options["Database"] = params.database;
|
|
24761
|
-
}
|
|
24762
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24763
|
-
});
|
|
24764
|
-
}
|
|
24765
|
-
|
|
24766
24665
|
function newRolePowerShellTool(server, config) {
|
|
24767
24666
|
server.tool("security-new-role", "Creates a new Sitecore role.", {
|
|
24768
24667
|
identity: stringType()
|
|
@@ -25193,77 +25092,6 @@ function getItemPowerShellTool(server, config) {
|
|
|
25193
25092
|
});
|
|
25194
25093
|
}
|
|
25195
25094
|
|
|
25196
|
-
function prepareArgsString(parameters) {
|
|
25197
|
-
let scriptWithParameters = "";
|
|
25198
|
-
if (parameters) {
|
|
25199
|
-
for (const parameter in parameters) {
|
|
25200
|
-
if (parameters[parameter] === "") {
|
|
25201
|
-
scriptWithParameters += ` -${parameter}`;
|
|
25202
|
-
}
|
|
25203
|
-
else if (Array.isArray(parameters[parameter])) {
|
|
25204
|
-
scriptWithParameters += ` -${parameter} "${parameters[parameter].join('","')}"`;
|
|
25205
|
-
}
|
|
25206
|
-
else {
|
|
25207
|
-
scriptWithParameters += ` -${parameter} "${parameters[parameter]}"`;
|
|
25208
|
-
}
|
|
25209
|
-
}
|
|
25210
|
-
}
|
|
25211
|
-
return scriptWithParameters;
|
|
25212
|
-
}
|
|
25213
|
-
|
|
25214
|
-
// This security tool doesn't have sense as it could be replaced with Add-ItemAcl+Clear-ItemAcl tools.
|
|
25215
|
-
// It is kept for testing "composite" tools.
|
|
25216
|
-
function setItemAclPowerShellTool(server, config) {
|
|
25217
|
-
server.tool("security-set-item-acl-by-id", "Sets an access control entry to a Sitecore item by its ID.", {
|
|
25218
|
-
id: stringType()
|
|
25219
|
-
.describe("The ID of the item to add ACL entry for"),
|
|
25220
|
-
identity: stringType()
|
|
25221
|
-
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
25222
|
-
accessRight: enumType(AccessRights)
|
|
25223
|
-
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
25224
|
-
propagationType: enumType(["Descendants", "Children", "Entity"]).default("Entity")
|
|
25225
|
-
.describe("The propagation type for the access right"),
|
|
25226
|
-
securityPermission: enumType(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
25227
|
-
.describe("Whether to allow or deny the specified access right"),
|
|
25228
|
-
}, async (params) => {
|
|
25229
|
-
const parameters1Obj = {};
|
|
25230
|
-
parameters1Obj["Identity"] = params.identity;
|
|
25231
|
-
parameters1Obj["AccessRight"] = params.accessRight;
|
|
25232
|
-
parameters1Obj["PropagationType"] = params.propagationType;
|
|
25233
|
-
parameters1Obj["SecurityPermission"] = params.securityPermission;
|
|
25234
|
-
const parameters1 = prepareArgsString(parameters1Obj);
|
|
25235
|
-
const command = `
|
|
25236
|
-
$acl = New-ItemAcl ${parameters1}
|
|
25237
|
-
Get-Item -Id ${params.id} | Set-ItemAcl -AccessRules $acl
|
|
25238
|
-
`.replaceAll(/[\n]+/g, "");
|
|
25239
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25240
|
-
});
|
|
25241
|
-
server.tool("security-set-item-acl-by-path", "Sets an access control entry to a Sitecore item by its path.", {
|
|
25242
|
-
path: stringType()
|
|
25243
|
-
.describe("The path of the item to add ACL entry for"),
|
|
25244
|
-
identity: stringType()
|
|
25245
|
-
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
25246
|
-
accessRight: enumType(AccessRights)
|
|
25247
|
-
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
25248
|
-
propagationType: enumType(["Descendants", "Children", "Entity"]).default("Entity")
|
|
25249
|
-
.describe("The propagation type for the access right"),
|
|
25250
|
-
securityPermission: enumType(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
25251
|
-
.describe("Whether to allow or deny the specified access right"),
|
|
25252
|
-
}, async (params) => {
|
|
25253
|
-
const parameters1Obj = {};
|
|
25254
|
-
parameters1Obj["Identity"] = params.identity;
|
|
25255
|
-
parameters1Obj["AccessRight"] = params.accessRight;
|
|
25256
|
-
parameters1Obj["PropagationType"] = params.propagationType;
|
|
25257
|
-
parameters1Obj["SecurityPermission"] = params.securityPermission;
|
|
25258
|
-
const parameters1 = prepareArgsString(parameters1Obj);
|
|
25259
|
-
const command = `
|
|
25260
|
-
$acl = New-ItemAcl ${parameters1}
|
|
25261
|
-
Get-Item -Path "${params.path}" | Set-ItemAcl -AccessRules $acl
|
|
25262
|
-
`.replaceAll(/[\n]+/g, "");
|
|
25263
|
-
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25264
|
-
});
|
|
25265
|
-
}
|
|
25266
|
-
|
|
25267
25095
|
function initializeSearchIndexPowerShellTool(server, config) {
|
|
25268
25096
|
server.tool("indexing-initialize-search-index", "Initialize one or more Sitecore search indexes. If no name is provided, all indexes will be initialized.", {
|
|
25269
25097
|
name: stringType().optional().describe("The name of the index to initialize. If not provided, all indexes will be initialized."),
|
|
@@ -25436,6 +25264,320 @@ async function findItemPowerShellTool(server, config) {
|
|
|
25436
25264
|
});
|
|
25437
25265
|
}
|
|
25438
25266
|
|
|
25267
|
+
function resumeSearchIndexPowerShellTool(server, config) {
|
|
25268
|
+
server.tool("indexing-resume-search-index", "Resume one or more Sitecore search indexes. If no name is provided, all paused indexes will be resumed.", {
|
|
25269
|
+
name: stringType().optional().describe("The name of the index to resume. If not provided, all paused indexes will be resumed."),
|
|
25270
|
+
}, async (params) => {
|
|
25271
|
+
const command = `Resume-SearchIndex`;
|
|
25272
|
+
const options = {};
|
|
25273
|
+
if (params.name) {
|
|
25274
|
+
options["Name"] = params.name;
|
|
25275
|
+
}
|
|
25276
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25277
|
+
});
|
|
25278
|
+
}
|
|
25279
|
+
|
|
25280
|
+
function suspendSearchIndexPowerShellTool(server, config) {
|
|
25281
|
+
server.tool("indexing-suspend-search-index", "Suspend one or more Sitecore search indexes. If no name is provided, all running indexes will be suspended.", {
|
|
25282
|
+
name: stringType().optional().describe("The name of the index to suspend. If not provided, all running indexes will be suspended."),
|
|
25283
|
+
}, async (params) => {
|
|
25284
|
+
const command = `Suspend-SearchIndex`;
|
|
25285
|
+
const options = {};
|
|
25286
|
+
if (params.name) {
|
|
25287
|
+
options["Name"] = params.name;
|
|
25288
|
+
}
|
|
25289
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25290
|
+
});
|
|
25291
|
+
}
|
|
25292
|
+
|
|
25293
|
+
function stopSearchIndexPowerShellTool(server, config) {
|
|
25294
|
+
server.tool("indexing-stop-search-index", "Stop one or more Sitecore search indexes. If no name is provided, all running indexes will be stopped.", {
|
|
25295
|
+
name: stringType().optional().describe("The name of the index to stop. If not provided, all running indexes will be stopped."),
|
|
25296
|
+
}, async (params) => {
|
|
25297
|
+
const command = `Stop-SearchIndex`;
|
|
25298
|
+
const options = {};
|
|
25299
|
+
if (params.name) {
|
|
25300
|
+
options["Name"] = params.name;
|
|
25301
|
+
}
|
|
25302
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25303
|
+
});
|
|
25304
|
+
}
|
|
25305
|
+
|
|
25306
|
+
function prepareArgsString(parameters) {
|
|
25307
|
+
let scriptWithParameters = "";
|
|
25308
|
+
if (parameters) {
|
|
25309
|
+
for (const parameter in parameters) {
|
|
25310
|
+
if (parameters[parameter] === "") {
|
|
25311
|
+
scriptWithParameters += ` -${parameter}`;
|
|
25312
|
+
}
|
|
25313
|
+
else if (Array.isArray(parameters[parameter])) {
|
|
25314
|
+
scriptWithParameters += ` -${parameter} "${parameters[parameter].join('","')}"`;
|
|
25315
|
+
}
|
|
25316
|
+
else {
|
|
25317
|
+
scriptWithParameters += ` -${parameter} "${parameters[parameter]}"`;
|
|
25318
|
+
}
|
|
25319
|
+
}
|
|
25320
|
+
}
|
|
25321
|
+
return scriptWithParameters;
|
|
25322
|
+
}
|
|
25323
|
+
|
|
25324
|
+
function setItemAclByIdPowerShellTool(server, config) {
|
|
25325
|
+
server.tool("security-set-item-acl-by-id", "Sets an access control entry to a Sitecore item by its ID.", {
|
|
25326
|
+
id: stringType()
|
|
25327
|
+
.describe("The ID of the item to add ACL entry for"),
|
|
25328
|
+
path: stringType()
|
|
25329
|
+
.default("master:")
|
|
25330
|
+
.optional(),
|
|
25331
|
+
identity: stringType()
|
|
25332
|
+
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
25333
|
+
accessRight: enumType(AccessRights)
|
|
25334
|
+
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
25335
|
+
propagationType: enumType(["Descendants", "Children", "Entity"]).default("Entity")
|
|
25336
|
+
.describe("The propagation type for the access right"),
|
|
25337
|
+
securityPermission: enumType(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
25338
|
+
.describe("Whether to allow or deny the specified access right"),
|
|
25339
|
+
}, async (params) => {
|
|
25340
|
+
const parameters1Obj = {};
|
|
25341
|
+
parameters1Obj["Identity"] = params.identity;
|
|
25342
|
+
parameters1Obj["AccessRight"] = params.accessRight;
|
|
25343
|
+
parameters1Obj["PropagationType"] = params.propagationType;
|
|
25344
|
+
parameters1Obj["SecurityPermission"] = params.securityPermission;
|
|
25345
|
+
const parameters1 = prepareArgsString(parameters1Obj);
|
|
25346
|
+
const command = `
|
|
25347
|
+
$acl = New-ItemAcl ${parameters1};
|
|
25348
|
+
Get-Item -Id ${params.id} -Path ${params.path} | Set-ItemAcl -AccessRules $acl
|
|
25349
|
+
`.replaceAll(/[\n]+/g, "");
|
|
25350
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25351
|
+
});
|
|
25352
|
+
}
|
|
25353
|
+
|
|
25354
|
+
function setItemAclByPathPowerShellTool(server, config) {
|
|
25355
|
+
server.tool("security-set-item-acl-by-path", "Sets an access control entry to a Sitecore item by its path.", {
|
|
25356
|
+
path: stringType()
|
|
25357
|
+
.describe("The path of the item to add ACL entry for"),
|
|
25358
|
+
identity: stringType()
|
|
25359
|
+
.describe("The identity of the account (user or role) to grant permissions to (e.g. 'sitecore\\admin')"),
|
|
25360
|
+
accessRight: enumType(AccessRights)
|
|
25361
|
+
.describe("The access right to grant (e.g. 'item:read', 'item:write')"),
|
|
25362
|
+
propagationType: enumType(["Descendants", "Children", "Entity"]).default("Entity")
|
|
25363
|
+
.describe("The propagation type for the access right"),
|
|
25364
|
+
securityPermission: enumType(["AllowAccess", "DenyAccess"]).default("AllowAccess")
|
|
25365
|
+
.describe("Whether to allow or deny the specified access right"),
|
|
25366
|
+
}, async (params) => {
|
|
25367
|
+
const parameters1Obj = {};
|
|
25368
|
+
parameters1Obj["Identity"] = params.identity;
|
|
25369
|
+
parameters1Obj["AccessRight"] = params.accessRight;
|
|
25370
|
+
parameters1Obj["PropagationType"] = params.propagationType;
|
|
25371
|
+
parameters1Obj["SecurityPermission"] = params.securityPermission;
|
|
25372
|
+
const parameters1 = prepareArgsString(parameters1Obj);
|
|
25373
|
+
const command = `
|
|
25374
|
+
$acl = New-ItemAcl ${parameters1};
|
|
25375
|
+
Get-Item -Path "${params.path}" | Set-ItemAcl -AccessRules $acl
|
|
25376
|
+
`.replaceAll(/[\n]+/g, "");
|
|
25377
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25378
|
+
});
|
|
25379
|
+
}
|
|
25380
|
+
|
|
25381
|
+
function initializeSearchIndexingItemByIdPowerShellTool(server, config) {
|
|
25382
|
+
server.tool("indexing-initialize-search-index-item-by-id", "Rebuilds the index for a given tree with the specified root item by id and index name. Supports wildcard filtering for the index name.", {
|
|
25383
|
+
id: stringType()
|
|
25384
|
+
.describe("The ID of the item to rebuild the index for"),
|
|
25385
|
+
path: stringType()
|
|
25386
|
+
.default("master:")
|
|
25387
|
+
.optional(),
|
|
25388
|
+
indexName: stringType()
|
|
25389
|
+
.default("sitecore_*_index")
|
|
25390
|
+
.optional()
|
|
25391
|
+
.describe("The name of the index to rebuild"),
|
|
25392
|
+
}, async (params) => {
|
|
25393
|
+
const command = `
|
|
25394
|
+
$item = Get-Item -Id ${params.id} -Path ${params.path};
|
|
25395
|
+
$indexName = "${params.indexName}";
|
|
25396
|
+
Initialize-SearchIndexItem -Item $item -Name $indexName
|
|
25397
|
+
`.replaceAll(/[\n]+/g, "");
|
|
25398
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25399
|
+
});
|
|
25400
|
+
}
|
|
25401
|
+
|
|
25402
|
+
function initializeSearchIndexingItemByPathPowerShellTool(server, config) {
|
|
25403
|
+
server.tool("indexing-initialize-search-index-item-by-path", "Rebuilds the index for a given tree with the specified root item by path and index name. Supports wildcard filtering for the index name.", {
|
|
25404
|
+
path: stringType()
|
|
25405
|
+
.describe("The path of the item to rebuild the index for"),
|
|
25406
|
+
indexName: stringType()
|
|
25407
|
+
.default("sitecore_*_index")
|
|
25408
|
+
.optional()
|
|
25409
|
+
.describe("The name of the index to rebuild"),
|
|
25410
|
+
}, async (params) => {
|
|
25411
|
+
const command = `
|
|
25412
|
+
$item = Get-Item -Path ${params.path};
|
|
25413
|
+
$indexName = "${params.indexName}";
|
|
25414
|
+
Initialize-SearchIndexItem -Item $item -Name $indexName
|
|
25415
|
+
`.replaceAll(/[\n]+/g, "");
|
|
25416
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25417
|
+
});
|
|
25418
|
+
}
|
|
25419
|
+
|
|
25420
|
+
function removeSearchIndexItemByIdPowerShellTool(server, config) {
|
|
25421
|
+
server.tool("indexing-remove-search-index-item-by-id", "Removes the item with the specified ID from the search index. Supports wildcard filtering for the index name.", {
|
|
25422
|
+
id: stringType()
|
|
25423
|
+
.describe("The ID of the item to remove from the index"),
|
|
25424
|
+
path: stringType()
|
|
25425
|
+
.default("master:")
|
|
25426
|
+
.optional(),
|
|
25427
|
+
indexName: stringType()
|
|
25428
|
+
.default("sitecore_*_index")
|
|
25429
|
+
.optional()
|
|
25430
|
+
.describe("The name of the index to remove the item from"),
|
|
25431
|
+
}, async (params) => {
|
|
25432
|
+
const command = `
|
|
25433
|
+
$item = Get-Item -Id ${params.id} -Path ${params.path};
|
|
25434
|
+
$indexName = "${params.indexName}";
|
|
25435
|
+
Remove-SearchIndexItem -Item $item -Name $indexName
|
|
25436
|
+
`.replaceAll(/[\n]+/g, "");
|
|
25437
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25438
|
+
});
|
|
25439
|
+
}
|
|
25440
|
+
|
|
25441
|
+
function removeSearchIndexItemByPathPowerShellTool(server, config) {
|
|
25442
|
+
server.tool("indexing-remove-search-index-item-by-path", "Removes the item with the specified path from the search index. Supports wildcard filtering for the index name.", {
|
|
25443
|
+
path: stringType()
|
|
25444
|
+
.describe("The path of the item to remove from the index"),
|
|
25445
|
+
indexName: stringType()
|
|
25446
|
+
.default("sitecore_*_index")
|
|
25447
|
+
.optional()
|
|
25448
|
+
.describe("The name of the index to remove the item from"),
|
|
25449
|
+
}, async (params) => {
|
|
25450
|
+
const command = `
|
|
25451
|
+
$item = Get-Item -Path ${params.path};
|
|
25452
|
+
$indexName = "${params.indexName}";
|
|
25453
|
+
Remove-SearchIndexItem -Item $item -Name $indexName
|
|
25454
|
+
`.replaceAll(/[\n]+/g, "");
|
|
25455
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, {}));
|
|
25456
|
+
});
|
|
25457
|
+
}
|
|
25458
|
+
|
|
25459
|
+
function lockItemByIdPowerShellTool(server, config) {
|
|
25460
|
+
server.tool("security-lock-item-by-id", "Lock a Sitecore item by its ID.", {
|
|
25461
|
+
id: stringType()
|
|
25462
|
+
.describe("The ID of the item to lock"),
|
|
25463
|
+
force: booleanType().optional()
|
|
25464
|
+
.describe("If set to true, will force the lock even if the item is locked by another user"),
|
|
25465
|
+
passThru: booleanType().optional()
|
|
25466
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
25467
|
+
database: stringType().optional()
|
|
25468
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
25469
|
+
}, async (params) => {
|
|
25470
|
+
const command = `Lock-Item`;
|
|
25471
|
+
const options = {
|
|
25472
|
+
"Id": params.id,
|
|
25473
|
+
};
|
|
25474
|
+
if (params.force) {
|
|
25475
|
+
options["Force"] = "";
|
|
25476
|
+
}
|
|
25477
|
+
if (params.passThru) {
|
|
25478
|
+
options["PassThru"] = "";
|
|
25479
|
+
}
|
|
25480
|
+
if (params.database) {
|
|
25481
|
+
options["Database"] = params.database;
|
|
25482
|
+
}
|
|
25483
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25484
|
+
});
|
|
25485
|
+
}
|
|
25486
|
+
|
|
25487
|
+
function lockItemByPathPowerShellTool(server, config) {
|
|
25488
|
+
server.tool("security-lock-item-by-path", "Lock a Sitecore item by its path.", {
|
|
25489
|
+
path: stringType()
|
|
25490
|
+
.describe("The path of the item to lock (e.g. /sitecore/content/Home)"),
|
|
25491
|
+
force: booleanType()
|
|
25492
|
+
.optional().describe("If set to true, will force the lock even if the item is locked by another user"),
|
|
25493
|
+
passThru: booleanType().optional()
|
|
25494
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
25495
|
+
database: stringType().optional()
|
|
25496
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
25497
|
+
}, async (params) => {
|
|
25498
|
+
const command = `Lock-Item`;
|
|
25499
|
+
const options = {
|
|
25500
|
+
"Path": params.path,
|
|
25501
|
+
};
|
|
25502
|
+
if (params.force) {
|
|
25503
|
+
options["Force"] = "";
|
|
25504
|
+
}
|
|
25505
|
+
if (params.passThru) {
|
|
25506
|
+
options["PassThru"] = "";
|
|
25507
|
+
}
|
|
25508
|
+
if (params.database) {
|
|
25509
|
+
options["Database"] = params.database;
|
|
25510
|
+
}
|
|
25511
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25512
|
+
});
|
|
25513
|
+
}
|
|
25514
|
+
|
|
25515
|
+
function unprotectItemByIdPowerShellTool(server, config) {
|
|
25516
|
+
server.tool("security-unprotect-item-by-id", "Unprotect a Sitecore item by its ID.", {
|
|
25517
|
+
id: stringType()
|
|
25518
|
+
.describe("The ID of the item to unprotect"),
|
|
25519
|
+
passThru: booleanType().optional()
|
|
25520
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
25521
|
+
database: stringType().optional()
|
|
25522
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
25523
|
+
}, async (params) => {
|
|
25524
|
+
const command = `Unprotect-Item`;
|
|
25525
|
+
const options = {
|
|
25526
|
+
"Id": params.id,
|
|
25527
|
+
};
|
|
25528
|
+
if (params.passThru) {
|
|
25529
|
+
options["PassThru"] = "";
|
|
25530
|
+
}
|
|
25531
|
+
if (params.database) {
|
|
25532
|
+
options["Database"] = params.database;
|
|
25533
|
+
}
|
|
25534
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25535
|
+
});
|
|
25536
|
+
}
|
|
25537
|
+
|
|
25538
|
+
function unprotectItemByPathPowerShellTool(server, config) {
|
|
25539
|
+
server.tool("security-unprotect-item-by-path", "Unprotect a Sitecore item by its path.", {
|
|
25540
|
+
path: stringType()
|
|
25541
|
+
.describe("The path of the item to unprotect (e.g. /sitecore/content/Home)"),
|
|
25542
|
+
passThru: booleanType().optional()
|
|
25543
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
25544
|
+
database: stringType().optional()
|
|
25545
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
25546
|
+
}, async (params) => {
|
|
25547
|
+
const command = `Unprotect-Item`;
|
|
25548
|
+
const options = {
|
|
25549
|
+
"Path": params.path,
|
|
25550
|
+
};
|
|
25551
|
+
if (params.passThru) {
|
|
25552
|
+
options["PassThru"] = "";
|
|
25553
|
+
}
|
|
25554
|
+
if (params.database) {
|
|
25555
|
+
options["Database"] = params.database;
|
|
25556
|
+
}
|
|
25557
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25558
|
+
});
|
|
25559
|
+
}
|
|
25560
|
+
|
|
25561
|
+
function getDomainByNamePowerShellTool(server, config) {
|
|
25562
|
+
server.tool("security-get-domain-by-name", "Get a Sitecore domain by its name.", {
|
|
25563
|
+
name: stringType(),
|
|
25564
|
+
}, async (params) => {
|
|
25565
|
+
const command = `Get-Domain`;
|
|
25566
|
+
const options = {
|
|
25567
|
+
"Name": params.name,
|
|
25568
|
+
};
|
|
25569
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25570
|
+
});
|
|
25571
|
+
}
|
|
25572
|
+
|
|
25573
|
+
function getAllDomainsPowerShellTool(server, config) {
|
|
25574
|
+
server.tool("security-get-domain", "Get all Sitecore domains.", {}, async () => {
|
|
25575
|
+
const command = `Get-Domain`;
|
|
25576
|
+
const options = {};
|
|
25577
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25578
|
+
});
|
|
25579
|
+
}
|
|
25580
|
+
|
|
25439
25581
|
async function register(array, server, config) {
|
|
25440
25582
|
for (const register of array) {
|
|
25441
25583
|
await register(server, config);
|
|
@@ -25443,7 +25585,8 @@ async function register(array, server, config) {
|
|
|
25443
25585
|
}
|
|
25444
25586
|
async function registerAll(server, config) {
|
|
25445
25587
|
await register([
|
|
25446
|
-
registerGraphQL,
|
|
25588
|
+
registerGraphQL,
|
|
25589
|
+
//Item Service
|
|
25447
25590
|
//Simple Item Service Tools
|
|
25448
25591
|
getItemTool,
|
|
25449
25592
|
getItemChildrenTool,
|
|
@@ -25456,10 +25599,13 @@ async function registerAll(server, config) {
|
|
|
25456
25599
|
runStoredSearchTool,
|
|
25457
25600
|
//Composite Item Service Tools
|
|
25458
25601
|
getItemDescendantsTool,
|
|
25459
|
-
getLanguagesTool,
|
|
25602
|
+
getLanguagesTool,
|
|
25603
|
+
//PowerShell tools
|
|
25460
25604
|
//Security
|
|
25461
25605
|
//Simple Security PowerShell Tools
|
|
25462
|
-
|
|
25606
|
+
getUserByIdentityPowerShellTool,
|
|
25607
|
+
getCurrentUserPowerShellTool,
|
|
25608
|
+
getUserByFilterPowerShellTool,
|
|
25463
25609
|
newUserPowerShellTool,
|
|
25464
25610
|
removeUserPowerShellTool,
|
|
25465
25611
|
disableUserPowerShellTool,
|
|
@@ -25467,15 +25613,20 @@ async function registerAll(server, config) {
|
|
|
25467
25613
|
unlockUserPowerShellTool,
|
|
25468
25614
|
setUserPowerShellTool,
|
|
25469
25615
|
setUserPasswordPowerShellTool,
|
|
25470
|
-
|
|
25471
|
-
|
|
25616
|
+
getDomainByNamePowerShellTool,
|
|
25617
|
+
getAllDomainsPowerShellTool,
|
|
25618
|
+
getRoleByIdentityPowerShellTool,
|
|
25619
|
+
getRoleByFilterPowerShellTool,
|
|
25472
25620
|
getRoleMemberPowerShellTool,
|
|
25473
25621
|
addRoleMemberPowerShellTool,
|
|
25474
25622
|
removeRoleMemberPowerShellTool,
|
|
25475
|
-
|
|
25623
|
+
lockItemByIdPowerShellTool,
|
|
25624
|
+
lockItemByPathPowerShellTool,
|
|
25476
25625
|
unlockItemPowerShellTool,
|
|
25477
|
-
|
|
25478
|
-
|
|
25626
|
+
protectItemByPathPowerShellTool,
|
|
25627
|
+
protectItemByIdPowerShellTool,
|
|
25628
|
+
unprotectItemByIdPowerShellTool,
|
|
25629
|
+
unprotectItemByPathPowerShellTool,
|
|
25479
25630
|
newRolePowerShellTool,
|
|
25480
25631
|
removeRolePowerShellTool,
|
|
25481
25632
|
newDomainPowerShellTool,
|
|
@@ -25486,13 +25637,19 @@ async function registerAll(server, config) {
|
|
|
25486
25637
|
addItemAclPowerShellTool,
|
|
25487
25638
|
clearItemAclPowerShellTool,
|
|
25488
25639
|
//Composite Security PowerShell Tools
|
|
25489
|
-
|
|
25640
|
+
setItemAclByIdPowerShellTool,
|
|
25641
|
+
setItemAclByPathPowerShellTool,
|
|
25490
25642
|
//Provider
|
|
25491
|
-
getItemPowerShellTool,
|
|
25492
|
-
|
|
25493
|
-
|
|
25494
|
-
|
|
25495
|
-
|
|
25643
|
+
getItemPowerShellTool, //Indexing PowerShell Tools
|
|
25644
|
+
initializeSearchIndexPowerShellTool, getSearchIndexPowerShellTool, findItemPowerShellTool,
|
|
25645
|
+
resumeSearchIndexPowerShellTool,
|
|
25646
|
+
suspendSearchIndexPowerShellTool,
|
|
25647
|
+
stopSearchIndexPowerShellTool,
|
|
25648
|
+
//Composite Indexing PowerShell Tools
|
|
25649
|
+
initializeSearchIndexingItemByIdPowerShellTool,
|
|
25650
|
+
initializeSearchIndexingItemByPathPowerShellTool,
|
|
25651
|
+
removeSearchIndexItemByIdPowerShellTool,
|
|
25652
|
+
removeSearchIndexItemByPathPowerShellTool,
|
|
25496
25653
|
], server, config);
|
|
25497
25654
|
}
|
|
25498
25655
|
|