@antonytm/mcp-sitecore-server 0.2.2 → 0.4.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 +45 -12
- package/dist/tools/powershell/client.js +3 -0
- package/dist/tools/powershell/client.js.map +1 -1
- package/dist/tools/powershell/simple/security/register-add-role-member.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-add-role-member.js +19 -0
- package/dist/tools/powershell/simple/security/register-add-role-member.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-get-role-member.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-get-role-member.js +31 -0
- package/dist/tools/powershell/simple/security/register-get-role-member.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-lock-item.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-lock-item.js +56 -0
- package/dist/tools/powershell/simple/security/register-lock-item.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-new-domain.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-new-domain.js +15 -0
- package/dist/tools/powershell/simple/security/register-new-domain.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-new-role.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-new-role.js +16 -0
- package/dist/tools/powershell/simple/security/register-new-role.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-protect-item.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-protect-item.js +46 -0
- package/dist/tools/powershell/simple/security/register-protect-item.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-remove-domain.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-remove-domain.js +16 -0
- package/dist/tools/powershell/simple/security/register-remove-domain.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-remove-role.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-remove-role.js +16 -0
- package/dist/tools/powershell/simple/security/register-remove-role.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-remove-rolemember.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-remove-rolemember.js +19 -0
- package/dist/tools/powershell/simple/security/register-remove-rolemember.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-security-powershell.js +26 -3
- package/dist/tools/powershell/simple/security/register-security-powershell.js.map +1 -1
- package/dist/tools/powershell/simple/security/register-test-account.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-test-account.js +21 -0
- package/dist/tools/powershell/simple/security/register-test-account.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-unlock-item.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-unlock-item.js +52 -0
- package/dist/tools/powershell/simple/security/register-unlock-item.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-unlock-user.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-unlock-user.js +16 -0
- package/dist/tools/powershell/simple/security/register-unlock-user.js.map +1 -0
- package/dist/tools/powershell/simple/security/register-unprotect-item.d.ts +3 -0
- package/dist/tools/powershell/simple/security/register-unprotect-item.js +46 -0
- package/dist/tools/powershell/simple/security/register-unprotect-item.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,14 +27,39 @@
|
|
|
27
27
|
- [x] `security-get-current-user`: returns the current user
|
|
28
28
|
- [x] `security-get-user-by-identity`: returns a user by name
|
|
29
29
|
- [x] `security-get-user-by-filter`: returns a user by filter
|
|
30
|
+
- [x] `security-new-domain`: creates a new domain
|
|
30
31
|
- [x] `security-new-user`: creates a new user
|
|
32
|
+
- [x] `security-new-role`: creates a new role
|
|
33
|
+
- [x] `security-remove-domain`: removes a domain
|
|
31
34
|
- [x] `security-remove-user`: removes a user
|
|
35
|
+
- [x] `security-remove-role`: removes a role
|
|
32
36
|
- [x] `security-get-domain`: returns a domains
|
|
33
37
|
- [x] `security-get-domain-by-name`: returns a domain by name
|
|
34
38
|
- [x] `security-get-role-by-identity`: returns a role by name
|
|
35
39
|
- [x] `security-get-role-by-filter`: returns a role by filter
|
|
40
|
+
- [x] `security-get-role-member`: returns members of a role
|
|
36
41
|
- [x] `security-enable-user`: enables a user
|
|
37
42
|
- [x] `security-disable-user`: disables a user
|
|
43
|
+
- [x] `security-lock-item-by-id`: locks an item by ID
|
|
44
|
+
- [x] `security-unlock-item-by-id`: unlocks an item by ID
|
|
45
|
+
- [x] `security-lock-item-by-path`: locks an item by path
|
|
46
|
+
- [x] `security-unlock-item-by-path`: unlocks an item by path
|
|
47
|
+
- [x] `security-protect-item-by-id`: protects an item by ID
|
|
48
|
+
- [x] `security-protect-item-by-path`: protects an item by path
|
|
49
|
+
- [x] `security-unprotect-item-by-id`: unprotects an item by ID
|
|
50
|
+
- [x] `security-unprotect-item-by-path`: unprotects an item by path
|
|
51
|
+
- [x] `security-test-acccount`: tests an account
|
|
52
|
+
- [x] `security-unlock-user`: unlocks a user
|
|
53
|
+
- [ ] test covergage requires logging user with wrong password
|
|
54
|
+
- [ ] `security-login-user`: logs in a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1367#issue-3055272174).
|
|
55
|
+
- [ ] `security-logout-user`: logs out a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1368)
|
|
56
|
+
- [ ] `security-export-user`: exports a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1370)
|
|
57
|
+
- [ ] `security-import-user`: imports a user. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1371)
|
|
58
|
+
- [ ] `security-export-role`: exports a role. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1369)
|
|
59
|
+
- [ ] `security-import-role`: imports a role. Blocked by [SPE issue](https://github.com/SitecorePowerShell/Console/issues/1372)
|
|
60
|
+
- [x] `security-add-role-member`: adds a member to a role
|
|
61
|
+
- [x] `security-remove-role-member`: removes a member from a role
|
|
62
|
+
|
|
38
63
|
- [ ] Sitecore CLI
|
|
39
64
|
|
|
40
65
|
## Installation
|
|
@@ -47,15 +72,19 @@ Add the following Model Context Protocol server to your Cursor, VS Code, Claud:
|
|
|
47
72
|
"command": "npx",
|
|
48
73
|
"args": ["@antonytm/mcp-sitecore-server@latest"],
|
|
49
74
|
"env": {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
75
|
+
"TRANSPORT": "stdio",
|
|
76
|
+
"GRAPHQL_ENDPOINT": "https://xmcloudcm.localhost/sitecore/api/graph/",
|
|
77
|
+
"GRAPHQL_SCHEMAS": "edge,master,core",
|
|
78
|
+
"GRAPHQL_API_KEY": "{6D3F291E-66A5-4703-887A-D549AF83D859}",
|
|
79
|
+
"GRAPHQL_HEADERS": "",
|
|
80
|
+
"ITEM_SERVICE_DOMAIN": "sitecore",
|
|
81
|
+
"ITEM_SERVICE_USERNAME": "admin",
|
|
82
|
+
"ITEM_SERVICE_PASSWORD": "b",
|
|
83
|
+
"ITEM_SERVICE_SERVER_URL": "https://xmcloudcm.localhost/",
|
|
84
|
+
"POWERSHELL_DOMAIN": "sitecore",
|
|
85
|
+
"POWERSHELL_USERNAME": "admin",
|
|
86
|
+
"POWERSHELL_PASSWORD": "b",
|
|
87
|
+
"POWERSHELL_SERVER_URL": "https://xmcloudcm.localhost/",
|
|
59
88
|
}
|
|
60
89
|
}
|
|
61
90
|
```
|
|
@@ -67,10 +96,14 @@ Add the following Model Context Protocol server to your Cursor, VS Code, Claud:
|
|
|
67
96
|
- `GRAPHQL_SCHEMAS`: The Sitecore schemas to use for the GraphQL API, comma-separated.
|
|
68
97
|
- `GRAPHQL_API_KEY`: The API key for the GraphQL endpoint.
|
|
69
98
|
- `GRAPHQL_HEADERS`: Additional headers to include in the GraphQL requests.
|
|
70
|
-
- `ITEM_SERVICE_DOMAIN`: The domain for the Item Service API
|
|
71
|
-
- `ITEM_SERVICE_USERNAME`: The username for the Item Service API
|
|
72
|
-
- `ITEM_SERVICE_PASSWORD`: The password for the Item Service API
|
|
99
|
+
- `ITEM_SERVICE_DOMAIN`: The domain for the Item Service API authentication. Default is `sitecore`.
|
|
100
|
+
- `ITEM_SERVICE_USERNAME`: The username for the Item Service API authentication.
|
|
101
|
+
- `ITEM_SERVICE_PASSWORD`: The password for the Item Service API authentication.
|
|
73
102
|
- `ITEM_SERVICE_SERVER_URL`: The base URL for the Item Service API.
|
|
103
|
+
- `POWERSHELL_DOMAIN`: The domain for the Sitecore PowerShell Remoting API authentication. Default is `sitecore`.
|
|
104
|
+
- `POWERSHELL_USERNAME`: The username for the Sitecore PowerShell Remoting API authentication.
|
|
105
|
+
- `POWERSHELL_PASSWORD`: The password for the Sitecore PowerShell Remoting API authentication.
|
|
106
|
+
- `POWERSHELL_SERVER_URL`: The base URL for the Sitecore PowerShell Remoting API.
|
|
74
107
|
|
|
75
108
|
## Resources list
|
|
76
109
|
|
|
@@ -25,6 +25,9 @@ class PowershellClient {
|
|
|
25
25
|
if (parameters[parameter] === "") {
|
|
26
26
|
scriptWithParameters += ` -${parameter}`;
|
|
27
27
|
}
|
|
28
|
+
else if (Array.isArray(parameters[parameter])) {
|
|
29
|
+
scriptWithParameters += ` -${parameter} "${parameters[parameter].join('","')}"`;
|
|
30
|
+
}
|
|
28
31
|
else {
|
|
29
32
|
scriptWithParameters += ` -${parameter} "${parameters[parameter]}"`;
|
|
30
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/tools/powershell/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,gBAAgB;IACV,SAAS,CAAS;IAClB,QAAQ,CAAS;IACjB,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,WAAW,GAAkB,IAAI,CAAC;IAE1C,YAAY,SAAiB,EAAE,QAAgB,EAAE,QAAgB,EAAE,SAAiB,UAAU;QAC1F,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,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M;YACd,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,IAAI;SAEb,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,MAAc,EAAE,aAAkC,EAAE;QACxE,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACxD,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI;iBAC3B,IAAI,CAAC,GAAG,CAAC;iBACT,IAAI,CAAC,GAAG,CAAC;iBACT,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;YAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerAddRoleMemberPowerShell(server, config) {
|
|
5
|
+
server.tool("security-add-role-member", "Adds a member to a Sitecore role.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the role to add members to (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
|
|
8
|
+
members: z.string()
|
|
9
|
+
.describe("The members to add to the role (comma-separated list of users or roles, e.g. 'sitecore\\user1,sitecore\\user2')"),
|
|
10
|
+
}, async (params) => {
|
|
11
|
+
const command = `Add-RoleMember`;
|
|
12
|
+
const options = {
|
|
13
|
+
"Identity": params.identity,
|
|
14
|
+
"Members": params.members.split(',').map(member => member.trim()).join('","'),
|
|
15
|
+
};
|
|
16
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=register-add-role-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-add-role-member.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-add-role-member.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,+BAA+B,CAAC,MAAiB,EAAE,MAAc;IAC7E,MAAM,CAAC,IAAI,CACP,0BAA0B,EAC1B,mCAAmC,EACnC;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,oGAAoG,CAAC;QACnH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;aACd,QAAQ,CAAC,iHAAiH,CAAC;KACnI,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,gBAAgB,CAAC;QACjC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;SAChF,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerGetRoleMemberPowerShell(server, config) {
|
|
5
|
+
server.tool("security-get-role-member", "Get members of a Sitecore role.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the role to get members from (e.g. 'sitecore\\Author')"),
|
|
8
|
+
recurse: z.boolean().optional()
|
|
9
|
+
.describe("If set to true, gets all members recursively (including members of nested roles)"),
|
|
10
|
+
userOnly: z.boolean().optional()
|
|
11
|
+
.describe("If set to true, only gets user members (excluding roles)"),
|
|
12
|
+
roleOnly: z.boolean().optional()
|
|
13
|
+
.describe("If set to true, only gets role members (excluding users)"),
|
|
14
|
+
}, async (params) => {
|
|
15
|
+
const command = `Get-RoleMember`;
|
|
16
|
+
const options = {
|
|
17
|
+
"Identity": params.identity,
|
|
18
|
+
};
|
|
19
|
+
if (params.recurse) {
|
|
20
|
+
options["Recurse"] = "";
|
|
21
|
+
}
|
|
22
|
+
if (params.userOnly) {
|
|
23
|
+
options["UserOnly"] = "";
|
|
24
|
+
}
|
|
25
|
+
if (params.roleOnly) {
|
|
26
|
+
options["RoleOnly"] = "";
|
|
27
|
+
}
|
|
28
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=register-get-role-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-get-role-member.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-get-role-member.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,+BAA+B,CAAC,MAAiB,EAAE,MAAc;IAC7E,MAAM,CAAC,IAAI,CACP,0BAA0B,EAC1B,iCAAiC,EACjC;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,wEAAwE,CAAC;QACvF,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,kFAAkF,CAAC;QACjG,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,0DAA0D,CAAC;QACzE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,0DAA0D,CAAC;KAC5E,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,gBAAgB,CAAC;QACjC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QAC5B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerLockItemPowerShell(server, config) {
|
|
5
|
+
server.tool("security-lock-item-by-path", "Lock a Sitecore item by its path.", {
|
|
6
|
+
path: z.string()
|
|
7
|
+
.describe("The path of the item to lock (e.g. /sitecore/content/Home)"),
|
|
8
|
+
force: z.boolean()
|
|
9
|
+
.optional().describe("If set to true, will force the lock even if the item is locked by another user"),
|
|
10
|
+
passThru: z.boolean().optional()
|
|
11
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
12
|
+
database: z.string().optional()
|
|
13
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
14
|
+
}, async (params) => {
|
|
15
|
+
const command = `Lock-Item`;
|
|
16
|
+
const options = {
|
|
17
|
+
"Path": params.path,
|
|
18
|
+
};
|
|
19
|
+
if (params.force) {
|
|
20
|
+
options["Force"] = "";
|
|
21
|
+
}
|
|
22
|
+
if (params.passThru) {
|
|
23
|
+
options["PassThru"] = "";
|
|
24
|
+
}
|
|
25
|
+
if (params.database) {
|
|
26
|
+
options["Database"] = params.database;
|
|
27
|
+
}
|
|
28
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
29
|
+
});
|
|
30
|
+
server.tool("security-lock-item-by-id", "Lock a Sitecore item by its ID.", {
|
|
31
|
+
id: z.string()
|
|
32
|
+
.describe("The ID of the item to lock"),
|
|
33
|
+
force: z.boolean().optional()
|
|
34
|
+
.describe("If set to true, will force the lock even if the item is locked by another user"),
|
|
35
|
+
passThru: z.boolean().optional()
|
|
36
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
37
|
+
database: z.string().optional()
|
|
38
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
39
|
+
}, async (params) => {
|
|
40
|
+
const command = `Lock-Item`;
|
|
41
|
+
const options = {
|
|
42
|
+
"Id": params.id,
|
|
43
|
+
};
|
|
44
|
+
if (params.force) {
|
|
45
|
+
options["Force"] = "";
|
|
46
|
+
}
|
|
47
|
+
if (params.passThru) {
|
|
48
|
+
options["PassThru"] = "";
|
|
49
|
+
}
|
|
50
|
+
if (params.database) {
|
|
51
|
+
options["Database"] = params.database;
|
|
52
|
+
}
|
|
53
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=register-lock-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-lock-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-lock-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAc;IACxE,MAAM,CAAC,IAAI,CACP,4BAA4B,EAC5B,mCAAmC,EACnC;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,4DAA4D,CAAC;QAC3E,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;aACb,QAAQ,EAAE,CAAC,QAAQ,CAAC,gFAAgF,CAAC;QAC1G,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,kEAAkE,CAAC;QACjF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,WAAW,CAAC;QAC5B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAA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
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerNewDomainPowerShell(server, config) {
|
|
5
|
+
server.tool("security-new-domain", "Creates a new Sitecore domain.", {
|
|
6
|
+
name: z.string().describe("The name of the domain to create"),
|
|
7
|
+
}, async (params) => {
|
|
8
|
+
const command = `New-Domain`;
|
|
9
|
+
const options = {
|
|
10
|
+
"Name": params.name,
|
|
11
|
+
};
|
|
12
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=register-new-domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-new-domain.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-new-domain.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAc;IACzE,MAAM,CAAC,IAAI,CACP,qBAAqB,EACrB,gCAAgC,EAChC;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KAChE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,YAAY,CAAC;QAC7B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerNewRolePowerShell(server, config) {
|
|
5
|
+
server.tool("security-new-role", "Creates a new Sitecore role.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the role to create (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
|
|
8
|
+
}, async (params) => {
|
|
9
|
+
const command = `New-Role`;
|
|
10
|
+
const options = {
|
|
11
|
+
"Identity": params.identity,
|
|
12
|
+
};
|
|
13
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=register-new-role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-new-role.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-new-role.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAc;IACvE,MAAM,CAAC,IAAI,CACP,mBAAmB,EACnB,8BAA8B,EAC9B;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,4FAA4F,CAAC;KAC1G,EACL,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,UAAU,CAAC;QAC3B,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerProtectItemPowerShell(server, config) {
|
|
5
|
+
server.tool("security-protect-item-by-path", "Protect a Sitecore item by its path.", {
|
|
6
|
+
path: z.string()
|
|
7
|
+
.describe("The path of the item to protect (e.g. /sitecore/content/Home)"),
|
|
8
|
+
passThru: z.boolean().optional()
|
|
9
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
10
|
+
database: z.string().optional()
|
|
11
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
12
|
+
}, async (params) => {
|
|
13
|
+
const command = `Protect-Item`;
|
|
14
|
+
const options = {
|
|
15
|
+
"Path": params.path,
|
|
16
|
+
};
|
|
17
|
+
if (params.passThru) {
|
|
18
|
+
options["PassThru"] = "";
|
|
19
|
+
}
|
|
20
|
+
if (params.database) {
|
|
21
|
+
options["Database"] = params.database;
|
|
22
|
+
}
|
|
23
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24
|
+
});
|
|
25
|
+
server.tool("security-protect-item-by-id", "Protect a Sitecore item by its ID.", {
|
|
26
|
+
id: z.string()
|
|
27
|
+
.describe("The ID of the item to protect"),
|
|
28
|
+
passThru: z.boolean().optional()
|
|
29
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
30
|
+
database: z.string().optional()
|
|
31
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
32
|
+
}, async (params) => {
|
|
33
|
+
const command = `Protect-Item`;
|
|
34
|
+
const options = {
|
|
35
|
+
"Id": params.id,
|
|
36
|
+
};
|
|
37
|
+
if (params.passThru) {
|
|
38
|
+
options["PassThru"] = "";
|
|
39
|
+
}
|
|
40
|
+
if (params.database) {
|
|
41
|
+
options["Database"] = params.database;
|
|
42
|
+
}
|
|
43
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=register-protect-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-protect-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-protect-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAc;IAC3E,MAAM,CAAC,IAAI,CACP,+BAA+B,EAC/B,sCAAsC,EACtC;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,+DAA+D,CAAC;QAC9E,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,kEAAkE,CAAC;QACjF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,cAAc,CAAC;QAC/B,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,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;IAEF,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,oCAAoC,EACpC;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;aACT,QAAQ,CAAC,+BAA+B,CAAC;QAC9C,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,kEAAkE,CAAC;QACjF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,cAAc,CAAC;QAC/B,MAAM,OAAO,GAAwB;YACjC,IAAI,EAAE,MAAM,CAAC,EAAE;SAClB,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerRemoveDomainPowerShell(server, config) {
|
|
5
|
+
server.tool("security-remove-domain", "Removes a Sitecore domain.", {
|
|
6
|
+
name: z.string()
|
|
7
|
+
.describe("The name of the domain to remove"),
|
|
8
|
+
}, async (params) => {
|
|
9
|
+
const command = `Remove-Domain`;
|
|
10
|
+
const options = {
|
|
11
|
+
"Name": params.name,
|
|
12
|
+
};
|
|
13
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=register-remove-domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-remove-domain.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-remove-domain.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,8BAA8B,CAAC,MAAiB,EAAE,MAAc;IAC5E,MAAM,CAAC,IAAI,CACP,wBAAwB,EACxB,4BAA4B,EAC5B;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,kCAAkC,CAAC;KACpD,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,eAAe,CAAC;QAChC,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerRemoveRolePowerShell(server, config) {
|
|
5
|
+
server.tool("security-remove-role", "Removes a Sitecore role.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the role to remove (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
|
|
8
|
+
}, async (params) => {
|
|
9
|
+
const command = `Remove-Role`;
|
|
10
|
+
const options = {
|
|
11
|
+
"Identity": params.identity,
|
|
12
|
+
};
|
|
13
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=register-remove-role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-remove-role.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-remove-role.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,sBAAsB,EACtB,0BAA0B,EAC1B;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,4FAA4F,CAAC;KAC9G,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,aAAa,CAAC;QAC9B,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerRemoveRoleMemberPowerShell(server, config) {
|
|
5
|
+
server.tool("security-remove-role-member", "Removes members from a Sitecore role.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the role to remove members from (e.g. 'CustomRole' or full path 'sitecore\\CustomRole')"),
|
|
8
|
+
members: z.string()
|
|
9
|
+
.describe("The members to remove from the role (comma-separated list of users or roles, e.g. 'sitecore\\user1,sitecore\\user2')"),
|
|
10
|
+
}, async (params) => {
|
|
11
|
+
const command = `Remove-RoleMember`;
|
|
12
|
+
const options = {
|
|
13
|
+
"Identity": params.identity,
|
|
14
|
+
"Members": params.members.split(',').map(member => member.trim()).join('","'),
|
|
15
|
+
};
|
|
16
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=register-remove-rolemember.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-remove-rolemember.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-remove-rolemember.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,kCAAkC,CAAC,MAAiB,EAAE,MAAc;IAChF,MAAM,CAAC,IAAI,CACP,6BAA6B,EAC7B,uCAAuC,EACvC;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,yGAAyG,CAAC;QACxH,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;aACd,QAAQ,CAAC,sHAAsH,CAAC;KACxI,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,mBAAmB,CAAC;QACpC,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;YAC3B,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;SAChF,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -1,20 +1,43 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
-
import { register } from "module";
|
|
4
1
|
import { registerGetUserPowerShell } from "./register-get-user.js";
|
|
5
2
|
import { registerNewUserPowerShell } from "./register-new-user.js";
|
|
6
3
|
import { registerRemoveUserPowerShell } from "./register-remove-user.js";
|
|
7
4
|
import { registerDisableUserPowerShell } from "./register-disable-user.js";
|
|
8
5
|
import { registerEnableUserPowerShell } from "./register-enable-user.js";
|
|
6
|
+
import { registerUnlockUserPowerShell } from "./register-unlock-user.js";
|
|
9
7
|
import { registerGetDomainPowerShell } from "./register-get-domain.js";
|
|
10
8
|
import { registerGetRolePowerShell } from "./register-get-role.js";
|
|
9
|
+
import { registerGetRoleMemberPowerShell } from "./register-get-role-member.js";
|
|
10
|
+
import { registerAddRoleMemberPowerShell } from "./register-add-role-member.js";
|
|
11
|
+
import { registerRemoveRoleMemberPowerShell } from "./register-remove-rolemember.js";
|
|
12
|
+
import { registerLockItemPowerShell } from "./register-lock-item.js";
|
|
13
|
+
import { registerUnlockItemPowerShell } from "./register-unlock-item.js";
|
|
14
|
+
import { registerProtectItemPowerShell } from "./register-protect-item.js";
|
|
15
|
+
import { registerUnprotectItemPowerShell } from "./register-unprotect-item.js";
|
|
16
|
+
import { registerNewRolePowerShell } from "./register-new-role.js";
|
|
17
|
+
import { registerRemoveRolePowerShell } from "./register-remove-role.js";
|
|
18
|
+
import { registerNewDomainPowerShell } from "./register-new-domain.js";
|
|
19
|
+
import { registerRemoveDomainPowerShell } from "./register-remove-domain.js";
|
|
20
|
+
import { registerTestAccountPowerShell } from "./register-test-account.js";
|
|
11
21
|
export function registerSecurityPowerShell(server, config) {
|
|
12
22
|
registerGetUserPowerShell(server, config);
|
|
13
23
|
registerNewUserPowerShell(server, config);
|
|
14
24
|
registerRemoveUserPowerShell(server, config);
|
|
15
25
|
registerDisableUserPowerShell(server, config);
|
|
16
26
|
registerEnableUserPowerShell(server, config);
|
|
27
|
+
registerUnlockUserPowerShell(server, config);
|
|
17
28
|
registerGetDomainPowerShell(server, config);
|
|
18
29
|
registerGetRolePowerShell(server, config);
|
|
30
|
+
registerGetRoleMemberPowerShell(server, config);
|
|
31
|
+
registerAddRoleMemberPowerShell(server, config);
|
|
32
|
+
registerRemoveRoleMemberPowerShell(server, config);
|
|
33
|
+
registerLockItemPowerShell(server, config);
|
|
34
|
+
registerUnlockItemPowerShell(server, config);
|
|
35
|
+
registerProtectItemPowerShell(server, config);
|
|
36
|
+
registerUnprotectItemPowerShell(server, config);
|
|
37
|
+
registerNewRolePowerShell(server, config);
|
|
38
|
+
registerRemoveRolePowerShell(server, config);
|
|
39
|
+
registerNewDomainPowerShell(server, config);
|
|
40
|
+
registerRemoveDomainPowerShell(server, config);
|
|
41
|
+
registerTestAccountPowerShell(server, config);
|
|
19
42
|
}
|
|
20
43
|
//# sourceMappingURL=register-security-powershell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"register-security-powershell.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-security-powershell.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,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AM,CAAC,CAAC;IAChD,kCAAkC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnD,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,+BAA+B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,4BAA4B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,2BAA2B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,8BAA8B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerTestAccountPowerShell(server, config) {
|
|
5
|
+
server.tool("security-test-account", "Tests if a Sitecore user exists and has specific properties.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the user to test (e.g. 'admin' or full path 'sitecore\\admin')"),
|
|
8
|
+
accountType: z.enum(["All", "User", "Role"]).optional()
|
|
9
|
+
.describe("The type of account to test (defaults to 'All')"),
|
|
10
|
+
}, async (params) => {
|
|
11
|
+
const command = `Test-Account`;
|
|
12
|
+
const options = {
|
|
13
|
+
"Identity": params.identity
|
|
14
|
+
};
|
|
15
|
+
if (params.accountType) {
|
|
16
|
+
options["AccountType"] = params.accountType;
|
|
17
|
+
}
|
|
18
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=register-test-account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-test-account.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-test-account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,6BAA6B,CAAC,MAAiB,EAAE,MAAc;IAC3E,MAAM,CAAC,IAAI,CACP,uBAAuB,EACvB,8DAA8D,EAC9D;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,gFAAgF,CAAC;QAC/F,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;aAClD,QAAQ,CAAC,iDAAiD,CAAC;KACnE,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,cAAc,CAAC;QAC/B,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,OAAO,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC;QAChD,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACjF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerUnlockItemPowerShell(server, config) {
|
|
5
|
+
server.tool("security-unlock-item-by-id", "Unlocks a Sitecore item by its ID.", {
|
|
6
|
+
id: z.string().describe("The ID of the item to unlock"),
|
|
7
|
+
force: z.boolean().optional().describe("When specified the item is unlocked regardless of the owner"),
|
|
8
|
+
passThru: z.boolean().optional().describe("When specified returns the item to the pipeline"),
|
|
9
|
+
database: z.string().optional().describe("The database containing the item"),
|
|
10
|
+
}, async (params) => {
|
|
11
|
+
const command = `Unlock-Item`;
|
|
12
|
+
const options = {
|
|
13
|
+
"ID": params.id,
|
|
14
|
+
};
|
|
15
|
+
if (params.force) {
|
|
16
|
+
options["Force"] = "";
|
|
17
|
+
}
|
|
18
|
+
if (params.passThru) {
|
|
19
|
+
options["PassThru"] = "";
|
|
20
|
+
}
|
|
21
|
+
if (params.database) {
|
|
22
|
+
options["Database"] = params.database;
|
|
23
|
+
}
|
|
24
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
25
|
+
});
|
|
26
|
+
server.tool("security-unlock-item-by-path", "Unlocks a Sitecore item by its path.", {
|
|
27
|
+
path: z.string()
|
|
28
|
+
.describe("The path to the item to unlock"),
|
|
29
|
+
force: z.boolean().optional()
|
|
30
|
+
.describe("When specified the item is unlocked regardless of the owner"),
|
|
31
|
+
passThru: z.boolean().optional()
|
|
32
|
+
.describe("When specified returns the item to the pipeline"),
|
|
33
|
+
database: z.string().optional()
|
|
34
|
+
.describe("The database containing the item"),
|
|
35
|
+
}, async (params) => {
|
|
36
|
+
const command = `Unlock-Item`;
|
|
37
|
+
const options = {
|
|
38
|
+
"Path": params.path,
|
|
39
|
+
};
|
|
40
|
+
if (params.force) {
|
|
41
|
+
options["Force"] = "";
|
|
42
|
+
}
|
|
43
|
+
if (params.passThru) {
|
|
44
|
+
options["PassThru"] = "";
|
|
45
|
+
}
|
|
46
|
+
if (params.database) {
|
|
47
|
+
options["Database"] = params.database;
|
|
48
|
+
}
|
|
49
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=register-unlock-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-unlock-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-unlock-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,4BAA4B,EAC5B,oCAAoC,EACpC;QACI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QACvD,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6DAA6D,CAAC;QACrG,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;QAC5F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;KAC/E,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,aAAa,CAAC;QAC9B,MAAM,OAAO,GAAwB;YACjC,IAAI,EAAE,MAAM,CAAC,EAAE;SAClB,CAAC;QAEF,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC1C,CAAC;QAED,OAAO,eAAe,CAAC,2BAA2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
|
4
|
+
export function registerUnlockUserPowerShell(server, config) {
|
|
5
|
+
server.tool("security-unlock-user", "Unlocks a Sitecore user account that has been locked out due to failed login attempts.", {
|
|
6
|
+
identity: z.string()
|
|
7
|
+
.describe("The identity of the user to unlock (e.g. 'admin' or full path 'sitecore\\admin')"),
|
|
8
|
+
}, async (params) => {
|
|
9
|
+
const command = `Unlock-User`;
|
|
10
|
+
const options = {
|
|
11
|
+
"Identity": params.identity,
|
|
12
|
+
};
|
|
13
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=register-unlock-user.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-unlock-user.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-unlock-user.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,4BAA4B,CAAC,MAAiB,EAAE,MAAc;IAC1E,MAAM,CAAC,IAAI,CACP,sBAAsB,EACtB,wFAAwF,EACxF;QACI,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;aACf,QAAQ,CAAC,kFAAkF,CAAC;KACpG,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,aAAa,CAAC;QAC9B,MAAM,OAAO,GAAwB;YACjC,UAAU,EAAE,MAAM,CAAC,QAAQ;SAC9B,CAAC;QAEF,OAAO,eAAe,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAClF,CAAC,CACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { safeMcpResponse } from "../../../../helper.js";
|
|
3
|
+
import { runGenericPowershellCommand } from "../generic.js";
|
|
4
|
+
export function registerUnprotectItemPowerShell(server, config) {
|
|
5
|
+
server.tool("security-unprotect-item-by-path", "Unprotect a Sitecore item by its path.", {
|
|
6
|
+
path: z.string()
|
|
7
|
+
.describe("The path of the item to unprotect (e.g. /sitecore/content/Home)"),
|
|
8
|
+
passThru: z.boolean().optional()
|
|
9
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
10
|
+
database: z.string().optional()
|
|
11
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
12
|
+
}, async (params) => {
|
|
13
|
+
const command = `Unprotect-Item`;
|
|
14
|
+
const options = {
|
|
15
|
+
"Path": params.path,
|
|
16
|
+
};
|
|
17
|
+
if (params.passThru) {
|
|
18
|
+
options["PassThru"] = "";
|
|
19
|
+
}
|
|
20
|
+
if (params.database) {
|
|
21
|
+
options["Database"] = params.database;
|
|
22
|
+
}
|
|
23
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
24
|
+
});
|
|
25
|
+
server.tool("security-unprotect-item-by-id", "Unprotect a Sitecore item by its ID.", {
|
|
26
|
+
id: z.string()
|
|
27
|
+
.describe("The ID of the item to unprotect"),
|
|
28
|
+
passThru: z.boolean().optional()
|
|
29
|
+
.describe("If set to true, passes the processed object back to the pipeline"),
|
|
30
|
+
database: z.string().optional()
|
|
31
|
+
.describe("The database containing the item (defaults to the context database)")
|
|
32
|
+
}, async (params) => {
|
|
33
|
+
const command = `Unprotect-Item`;
|
|
34
|
+
const options = {
|
|
35
|
+
"Id": params.id,
|
|
36
|
+
};
|
|
37
|
+
if (params.passThru) {
|
|
38
|
+
options["PassThru"] = "";
|
|
39
|
+
}
|
|
40
|
+
if (params.database) {
|
|
41
|
+
options["Database"] = params.database;
|
|
42
|
+
}
|
|
43
|
+
return safeMcpResponse(runGenericPowershellCommand(config, command, options));
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=register-unprotect-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-unprotect-item.js","sourceRoot":"","sources":["../../../../../src/tools/powershell/simple/security/register-unprotect-item.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAE5D,MAAM,UAAU,+BAA+B,CAAC,MAAiB,EAAE,MAAc;IAC7E,MAAM,CAAC,IAAI,CACP,iCAAiC,EACjC,wCAAwC,EACxC;QACI,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;aACX,QAAQ,CAAC,iEAAiE,CAAC;QAChF,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;aAC3B,QAAQ,CAAC,kEAAkE,CAAC;QACjF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;aAC1B,QAAQ,CAAC,qEAAqE,CAAC;KACvF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACb,MAAM,OAAO,GAAG,gBAAgB,CAAC;QACjC,MAAM,OAAO,GAAwB;YACjC,MAAM,EAAE,MAAM,CAAC,IAAI;SACtB,CAAC;QAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;QAC7B,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAClB,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;IAEF,MAAM,CAAC,IAAI,CACP,+BAA+B,EAC/B,sCAAsC,EACtC;QACI,EAAE,EAAE,CAA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