@antonytm/mcp-sitecore-server 1.2.4-verbose-logging → 1.3.1
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/dist/bundle.js +1871 -2147
- package/dist/config.d.ts +0 -6
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/helper.js +1 -4
- package/dist/helper.js.map +1 -1
- package/dist/tools/item-service/client.d.ts +1 -2
- package/dist/tools/item-service/client.js +15 -298
- package/dist/tools/item-service/client.js.map +1 -1
- package/dist/tools/item-service/logic/composite/get-item-descendants.js +1 -1
- package/dist/tools/item-service/logic/composite/get-item-descendants.js.map +1 -1
- package/dist/tools/item-service/logic/composite/get-languages.js +1 -1
- package/dist/tools/item-service/logic/composite/get-languages.js.map +1 -1
- package/dist/tools/item-service/logic/simple/create-item.js +1 -1
- package/dist/tools/item-service/logic/simple/create-item.js.map +1 -1
- package/dist/tools/item-service/logic/simple/delete-item.js +1 -1
- package/dist/tools/item-service/logic/simple/delete-item.js.map +1 -1
- package/dist/tools/item-service/logic/simple/edit-item.js +1 -15
- package/dist/tools/item-service/logic/simple/edit-item.js.map +1 -1
- package/dist/tools/item-service/logic/simple/get-item-by-path.js +1 -1
- package/dist/tools/item-service/logic/simple/get-item-by-path.js.map +1 -1
- package/dist/tools/item-service/logic/simple/get-item-children.js +1 -1
- package/dist/tools/item-service/logic/simple/get-item-children.js.map +1 -1
- package/dist/tools/item-service/logic/simple/get-item.js +1 -1
- package/dist/tools/item-service/logic/simple/get-item.js.map +1 -1
- package/dist/tools/item-service/logic/simple/run-stored-query.js +1 -1
- package/dist/tools/item-service/logic/simple/run-stored-query.js.map +1 -1
- package/dist/tools/item-service/logic/simple/run-stored-search.js +1 -1
- package/dist/tools/item-service/logic/simple/run-stored-search.js.map +1 -1
- package/dist/tools/item-service/logic/simple/search-items.js +1 -1
- package/dist/tools/item-service/logic/simple/search-items.js.map +1 -1
- package/dist/tools/item-service/tools/simple/edit-item.js +1 -4
- package/dist/tools/item-service/tools/simple/edit-item.js.map +1 -1
- package/package.json +6 -5
- package/dist/logLevel.d.ts +0 -7
- package/dist/logLevel.js +0 -9
- package/dist/logLevel.js.map +0 -1
package/dist/config.d.ts
CHANGED
|
@@ -52,7 +52,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
52
52
|
serverUrl: string;
|
|
53
53
|
}>>;
|
|
54
54
|
authorizationHeader: z.ZodDefault<z.ZodString>;
|
|
55
|
-
logLevel: z.ZodDefault<z.ZodString>;
|
|
56
55
|
}, "strip", z.ZodTypeAny, {
|
|
57
56
|
name: string;
|
|
58
57
|
graphQL: {
|
|
@@ -74,7 +73,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
74
73
|
serverUrl: string;
|
|
75
74
|
};
|
|
76
75
|
authorizationHeader: string;
|
|
77
|
-
logLevel: string;
|
|
78
76
|
version?: string | undefined;
|
|
79
77
|
}, {
|
|
80
78
|
name?: string | undefined;
|
|
@@ -98,7 +96,6 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
98
96
|
serverUrl: string;
|
|
99
97
|
} | undefined;
|
|
100
98
|
authorizationHeader?: string | undefined;
|
|
101
|
-
logLevel?: string | undefined;
|
|
102
99
|
}>;
|
|
103
100
|
export declare const envSchema: z.ZodObject<{
|
|
104
101
|
GRAPHQL_ENDPOINT: z.ZodOptional<z.ZodString>;
|
|
@@ -114,7 +111,6 @@ export declare const envSchema: z.ZodObject<{
|
|
|
114
111
|
POWERSHELL_PASSWORD: z.ZodOptional<z.ZodString>;
|
|
115
112
|
POWERSHELL_SERVER_URL: z.ZodOptional<z.ZodString>;
|
|
116
113
|
AUTORIZATION_HEADER: z.ZodOptional<z.ZodString>;
|
|
117
|
-
LOG_LEVEL: z.ZodOptional<z.ZodString>;
|
|
118
114
|
}, "strip", z.ZodTypeAny, {
|
|
119
115
|
GRAPHQL_ENDPOINT?: string | undefined;
|
|
120
116
|
GRAPHQL_SCHEMAS?: string | undefined;
|
|
@@ -129,7 +125,6 @@ export declare const envSchema: z.ZodObject<{
|
|
|
129
125
|
POWERSHELL_PASSWORD?: string | undefined;
|
|
130
126
|
POWERSHELL_SERVER_URL?: string | undefined;
|
|
131
127
|
AUTORIZATION_HEADER?: string | undefined;
|
|
132
|
-
LOG_LEVEL?: string | undefined;
|
|
133
128
|
}, {
|
|
134
129
|
GRAPHQL_ENDPOINT?: string | undefined;
|
|
135
130
|
GRAPHQL_SCHEMAS?: string | undefined;
|
|
@@ -144,7 +139,6 @@ export declare const envSchema: z.ZodObject<{
|
|
|
144
139
|
POWERSHELL_PASSWORD?: string | undefined;
|
|
145
140
|
POWERSHELL_SERVER_URL?: string | undefined;
|
|
146
141
|
AUTORIZATION_HEADER?: string | undefined;
|
|
147
|
-
LOG_LEVEL?: string | undefined;
|
|
148
142
|
}>;
|
|
149
143
|
export declare const envStartSchema: z.ZodObject<{
|
|
150
144
|
TRANSPORT: z.ZodEffects<z.ZodOptional<z.ZodDefault<z.ZodString>>, "stdio" | "sse" | "streamable-http", string | undefined>;
|
package/dist/config.js
CHANGED
|
@@ -3,7 +3,6 @@ import { fileURLToPath } from "node:url";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import 'dotenv/config.js';
|
|
6
|
-
import { LogLevel } from "./logLevel.js";
|
|
7
6
|
const ConfigSchema = z.object({
|
|
8
7
|
name: z.string().default("mcp-sitecore-server"),
|
|
9
8
|
version: z.string().optional(),
|
|
@@ -40,8 +39,7 @@ const ConfigSchema = z.object({
|
|
|
40
39
|
password: "b",
|
|
41
40
|
serverUrl: "https://xmcloudcm.localhost/",
|
|
42
41
|
}),
|
|
43
|
-
authorizationHeader: z.string().default("")
|
|
44
|
-
logLevel: z.string().default(LogLevel.INFO),
|
|
42
|
+
authorizationHeader: z.string().default("")
|
|
45
43
|
});
|
|
46
44
|
export const envSchema = z.object({
|
|
47
45
|
GRAPHQL_ENDPOINT: z.string().url().optional(),
|
|
@@ -57,7 +55,6 @@ export const envSchema = z.object({
|
|
|
57
55
|
POWERSHELL_PASSWORD: z.string().optional(),
|
|
58
56
|
POWERSHELL_SERVER_URL: z.string().url().optional(),
|
|
59
57
|
AUTORIZATION_HEADER: z.string().optional(),
|
|
60
|
-
LOG_LEVEL: z.string().optional(),
|
|
61
58
|
});
|
|
62
59
|
export const envStartSchema = z.object({
|
|
63
60
|
//* The transport to use for the server. Can be one of 'stdio' or 'sse'.
|
|
@@ -101,7 +98,6 @@ const config = {
|
|
|
101
98
|
serverUrl: ENV.POWERSHELL_SERVER_URL || "https://xmcloudcm.localhost/",
|
|
102
99
|
},
|
|
103
100
|
authorizationHeader: ENV.AUTORIZATION_HEADER || "",
|
|
104
|
-
logLevel: ENV.LOG_LEVEL || LogLevel.INFO,
|
|
105
101
|
};
|
|
106
102
|
export { config };
|
|
107
103
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,kBAAkB,CAAC;AAE1B,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,C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CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC;QACrG,MAAM,EAAE,GAAG,CAAC,eAAe,IAAI,wCAAwC;QACvE,OAAO,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE;KACtE;IACD,WAAW,EAAE;QACT,MAAM,EAAE,GAAG,CAAC,mBAAmB,IAAI,UAAU;QAC7C,QAAQ,EAAE,GAAG,CAAC,qBAAqB,IAAI,OAAO;QAC9C,QAAQ,EAAE,GAAG,CAAC,qBAAqB,IAAI,GAAG;QAC1C,SAAS,EAAE,GAAG,CAAC,uBAAuB,IAAI,8BAA8B;KAC3E;IACD,UAAU,EAAE;QACR,MAAM,EAAE,GAAG,CAAC,iBAAiB,IAAI,UAAU;QAC3C,QAAQ,EAAE,GAAG,CAAC,mBAAmB,IAAI,OAAO;QAC5C,QAAQ,EAAE,GAAG,CAAC,mBAAmB,IAAI,GAAG;QACxC,SAAS,EAAE,GAAG,CAAC,qBAAqB,IAAI,8BAA8B;KACzE;IACD,mBAAmB,EAAE,GAAG,CAAC,mBAAmB,IAAI,EAAE;CACrD,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/helper.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {} from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
export async function safeMcpResponse(exec) {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
let result = await exec;
|
|
6
|
-
console.log('Safe MCP Response: Success', result);
|
|
7
|
-
return result;
|
|
4
|
+
return await exec;
|
|
8
5
|
}
|
|
9
6
|
catch (error) {
|
|
10
7
|
console.error('Error executing tool:', error);
|
package/dist/helper.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,oCAAoC,CAAC;AAEzE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAA6B;IAC/D,IAAI,CAAC;QACD,OAAO,
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,oCAAoC,CAAC;AAEzE,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAA6B;IAC/D,IAAI,CAAC;QACD,OAAO,MAAM,IAAI,CAAC;IACtB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;QAC9C,OAAO;YACH,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACL;oBACI,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,yBAAyB,KAAK,EAAE;iBACzC;aACJ;SACJ,CAAC;IACN,CAAC;AACL,CAAC"}
|
|
@@ -5,8 +5,7 @@ declare class RestfulItemServiceClient {
|
|
|
5
5
|
private domain;
|
|
6
6
|
private authCookie;
|
|
7
7
|
private isInitialized;
|
|
8
|
-
|
|
9
|
-
constructor(serverUrl: string, username: string, password: string, domain?: string, logLevel?: string);
|
|
8
|
+
constructor(serverUrl: string, username: string, password: string, domain?: string);
|
|
10
9
|
/**
|
|
11
10
|
* Initializes the client by logging in and setting the authentication cookie.
|
|
12
11
|
* @returns {Promise<void>} - Resolves if initialization is successful.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LogLevel } from "../../logLevel.js";
|
|
2
1
|
class RestfulItemServiceClient {
|
|
3
2
|
serverUrl;
|
|
4
3
|
username;
|
|
@@ -6,13 +5,11 @@ class RestfulItemServiceClient {
|
|
|
6
5
|
domain;
|
|
7
6
|
authCookie = null;
|
|
8
7
|
isInitialized = false;
|
|
9
|
-
|
|
10
|
-
constructor(serverUrl, username, password, domain = 'sitecore', logLevel = LogLevel.INFO) {
|
|
8
|
+
constructor(serverUrl, username, password, domain = 'sitecore') {
|
|
11
9
|
this.serverUrl = serverUrl;
|
|
12
10
|
this.username = username;
|
|
13
11
|
this.password = password;
|
|
14
12
|
this.domain = domain;
|
|
15
|
-
this.logLevel = logLevel;
|
|
16
13
|
}
|
|
17
14
|
/**
|
|
18
15
|
* Initializes the client by logging in and setting the authentication cookie.
|
|
@@ -20,28 +17,15 @@ class RestfulItemServiceClient {
|
|
|
20
17
|
*/
|
|
21
18
|
async initialize() {
|
|
22
19
|
if (!this.isInitialized) {
|
|
23
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
24
|
-
console.log('Item Service Client: Initializing client...', JSON.stringify({
|
|
25
|
-
serverUrl: this.serverUrl,
|
|
26
|
-
username: this.username,
|
|
27
|
-
domain: this.domain
|
|
28
|
-
}, null, '\t'));
|
|
29
|
-
}
|
|
30
20
|
try {
|
|
31
21
|
await this.login();
|
|
32
22
|
this.isInitialized = true;
|
|
33
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
34
|
-
console.log('Item Service Client: Successfully initialized');
|
|
35
|
-
}
|
|
36
23
|
}
|
|
37
24
|
catch (error) {
|
|
38
25
|
console.error('Failed to initialize client:', error);
|
|
39
26
|
throw error;
|
|
40
27
|
}
|
|
41
28
|
}
|
|
42
|
-
else if (this.logLevel === LogLevel.DEBUG) {
|
|
43
|
-
console.log('Item Service Client: Already initialized, skipping initialization');
|
|
44
|
-
}
|
|
45
29
|
}
|
|
46
30
|
/**
|
|
47
31
|
* Logs in to the Sitecore server and sets the authentication cookie.
|
|
@@ -49,31 +33,16 @@ class RestfulItemServiceClient {
|
|
|
49
33
|
*/
|
|
50
34
|
async login() {
|
|
51
35
|
const url = `${this.serverUrl}/sitecore/api/ssc/auth/login`;
|
|
52
|
-
const loginData = {
|
|
53
|
-
username: this.username,
|
|
54
|
-
password: this.password,
|
|
55
|
-
domain: this.domain
|
|
56
|
-
};
|
|
57
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
58
|
-
console.log('Item Service Client: Attempting login...', JSON.stringify({
|
|
59
|
-
url,
|
|
60
|
-
username: this.username,
|
|
61
|
-
domain: this.domain
|
|
62
|
-
}, null, '\t'));
|
|
63
|
-
}
|
|
64
36
|
try {
|
|
65
37
|
const response = await fetch(url, {
|
|
66
38
|
method: 'POST',
|
|
67
39
|
headers: { 'Content-Type': 'application/json' },
|
|
68
|
-
body: JSON.stringify(
|
|
40
|
+
body: JSON.stringify({
|
|
41
|
+
username: this.username,
|
|
42
|
+
password: this.password,
|
|
43
|
+
domain: this.domain
|
|
44
|
+
})
|
|
69
45
|
});
|
|
70
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
71
|
-
console.log('Item Service Client: Login response received', JSON.stringify({
|
|
72
|
-
status: response.status,
|
|
73
|
-
statusText: response.statusText,
|
|
74
|
-
headers: Object.fromEntries(response.headers.entries())
|
|
75
|
-
}, null, '\t'));
|
|
76
|
-
}
|
|
77
46
|
if (!response.ok) {
|
|
78
47
|
throw new Error('Login failed');
|
|
79
48
|
}
|
|
@@ -82,9 +51,6 @@ class RestfulItemServiceClient {
|
|
|
82
51
|
const match = cookies.match(/\.AspNet\.Cookies=([^;]+);/);
|
|
83
52
|
if (match) {
|
|
84
53
|
this.authCookie = match[1];
|
|
85
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
86
|
-
console.log('Item Service Client: Authentication cookie retrieved successfully');
|
|
87
|
-
}
|
|
88
54
|
}
|
|
89
55
|
}
|
|
90
56
|
else {
|
|
@@ -95,9 +61,6 @@ class RestfulItemServiceClient {
|
|
|
95
61
|
}
|
|
96
62
|
}
|
|
97
63
|
catch (error) {
|
|
98
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
99
|
-
console.error('Item Service Client: Login failed', error);
|
|
100
|
-
}
|
|
101
64
|
if (error instanceof Error) {
|
|
102
65
|
throw new Error(`Failed to log in: ${error.message}`);
|
|
103
66
|
}
|
|
@@ -121,42 +84,16 @@ class RestfulItemServiceClient {
|
|
|
121
84
|
params.set('fields', options.fields.join(','));
|
|
122
85
|
}
|
|
123
86
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/${id}?${params.toString()}`;
|
|
124
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
125
|
-
console.log('Item Service Client: Getting item by ID...', JSON.stringify({
|
|
126
|
-
id,
|
|
127
|
-
options,
|
|
128
|
-
url
|
|
129
|
-
}, null, '\t'));
|
|
130
|
-
}
|
|
131
87
|
try {
|
|
132
88
|
const response = await fetch(url, {
|
|
133
89
|
headers: { 'Cookie': `.AspNet.Cookies=${this.authCookie}` }
|
|
134
90
|
});
|
|
135
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
136
|
-
console.log('Item Service Client: Get item by ID response received', JSON.stringify({
|
|
137
|
-
status: response.status,
|
|
138
|
-
statusText: response.statusText
|
|
139
|
-
}, null, '\t'));
|
|
140
|
-
}
|
|
141
91
|
if (!response.ok) {
|
|
142
92
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
143
93
|
}
|
|
144
|
-
|
|
145
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
146
|
-
console.log('Item Service Client: Item retrieved successfully', JSON.stringify({
|
|
147
|
-
itemId: id,
|
|
148
|
-
resultKeys: Object.keys(result)
|
|
149
|
-
}, null, '\t'));
|
|
150
|
-
}
|
|
151
|
-
return result;
|
|
94
|
+
return await response.json();
|
|
152
95
|
}
|
|
153
96
|
catch (error) {
|
|
154
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
155
|
-
console.error('Item Service Client: Failed to get item by ID', JSON.stringify({
|
|
156
|
-
id,
|
|
157
|
-
error
|
|
158
|
-
}, null, '\t'));
|
|
159
|
-
}
|
|
160
97
|
if (error instanceof Error) {
|
|
161
98
|
throw new Error(`Failed to retrieve item by ID: ${error.message}`);
|
|
162
99
|
}
|
|
@@ -180,42 +117,16 @@ class RestfulItemServiceClient {
|
|
|
180
117
|
params.set('fields', options.fields.join(','));
|
|
181
118
|
}
|
|
182
119
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/${id}/children?${params.toString()}`;
|
|
183
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
184
|
-
console.log('Item Service Client: Getting item children...', JSON.stringify({
|
|
185
|
-
id,
|
|
186
|
-
options,
|
|
187
|
-
url
|
|
188
|
-
}, null, '\t'));
|
|
189
|
-
}
|
|
190
120
|
try {
|
|
191
121
|
const response = await fetch(url, {
|
|
192
122
|
headers: { 'Cookie': `.AspNet.Cookies=${this.authCookie}` }
|
|
193
123
|
});
|
|
194
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
195
|
-
console.log('Item Service Client: Get item children response received', JSON.stringify({
|
|
196
|
-
status: response.status,
|
|
197
|
-
statusText: response.statusText
|
|
198
|
-
}, null, '\t'));
|
|
199
|
-
}
|
|
200
124
|
if (!response.ok) {
|
|
201
125
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
202
126
|
}
|
|
203
|
-
|
|
204
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
205
|
-
console.log('Item Service Client: Item children retrieved successfully', JSON.stringify({
|
|
206
|
-
parentId: id,
|
|
207
|
-
resultKeys: Object.keys(result)
|
|
208
|
-
}, null, '\t'));
|
|
209
|
-
}
|
|
210
|
-
return result;
|
|
127
|
+
return await response.json();
|
|
211
128
|
}
|
|
212
129
|
catch (error) {
|
|
213
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
214
|
-
console.error('Item Service Client: Failed to get item children', JSON.stringify({
|
|
215
|
-
id,
|
|
216
|
-
error
|
|
217
|
-
}, null, '\t'));
|
|
218
|
-
}
|
|
219
130
|
if (error instanceof Error) {
|
|
220
131
|
throw new Error(`Failed to retrieve item children: ${error.message}`);
|
|
221
132
|
}
|
|
@@ -241,43 +152,16 @@ class RestfulItemServiceClient {
|
|
|
241
152
|
params.set('fields', options.fields.join(','));
|
|
242
153
|
}
|
|
243
154
|
const url = `${this.serverUrl}/sitecore/api/ssc/item?path=${encodedPath}&${params.toString()}`;
|
|
244
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
245
|
-
console.log('Item Service Client: Getting item by path...', JSON.stringify({
|
|
246
|
-
path,
|
|
247
|
-
encodedPath,
|
|
248
|
-
options,
|
|
249
|
-
url
|
|
250
|
-
}, null, '\t'));
|
|
251
|
-
}
|
|
252
155
|
try {
|
|
253
156
|
const response = await fetch(url, {
|
|
254
157
|
headers: { 'Cookie': `.AspNet.Cookies=${this.authCookie}` }
|
|
255
158
|
});
|
|
256
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
257
|
-
console.log('Item Service Client: Get item by path response received', JSON.stringify({
|
|
258
|
-
status: response.status,
|
|
259
|
-
statusText: response.statusText
|
|
260
|
-
}, null, '\t'));
|
|
261
|
-
}
|
|
262
159
|
if (!response.ok) {
|
|
263
160
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
264
161
|
}
|
|
265
|
-
|
|
266
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
267
|
-
console.log('Item Service Client: Item retrieved by path successfully', JSON.stringify({
|
|
268
|
-
path,
|
|
269
|
-
resultKeys: Object.keys(result)
|
|
270
|
-
}, null, '\t'));
|
|
271
|
-
}
|
|
272
|
-
return result;
|
|
162
|
+
return await response.json();
|
|
273
163
|
}
|
|
274
164
|
catch (error) {
|
|
275
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
276
|
-
console.error('Item Service Client: Failed to get item by path', JSON.stringify({
|
|
277
|
-
path,
|
|
278
|
-
error
|
|
279
|
-
}, null, '\t'));
|
|
280
|
-
}
|
|
281
165
|
if (error instanceof Error) {
|
|
282
166
|
throw new Error(`Failed to retrieve item by path: ${error.message}`);
|
|
283
167
|
}
|
|
@@ -301,15 +185,6 @@ class RestfulItemServiceClient {
|
|
|
301
185
|
const encodedPath = encodeURIComponent(parentPath);
|
|
302
186
|
const params = new URLSearchParams(options);
|
|
303
187
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/${encodedPath}?${params.toString()}`;
|
|
304
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
305
|
-
console.log('Item Service Client: Creating item...', JSON.stringify({
|
|
306
|
-
parentPath,
|
|
307
|
-
encodedPath,
|
|
308
|
-
data,
|
|
309
|
-
options,
|
|
310
|
-
url
|
|
311
|
-
}, null, '\t'));
|
|
312
|
-
}
|
|
313
188
|
try {
|
|
314
189
|
const response = await fetch(url, {
|
|
315
190
|
method: 'POST',
|
|
@@ -319,38 +194,16 @@ class RestfulItemServiceClient {
|
|
|
319
194
|
},
|
|
320
195
|
body: JSON.stringify(data)
|
|
321
196
|
});
|
|
322
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
323
|
-
console.log('Item Service Client: Create item response received', JSON.stringify({
|
|
324
|
-
status: response.status,
|
|
325
|
-
statusText: response.statusText
|
|
326
|
-
}, null, '\t'));
|
|
327
|
-
}
|
|
328
197
|
if (!response.ok) {
|
|
329
198
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
330
199
|
}
|
|
331
|
-
|
|
200
|
+
return {
|
|
332
201
|
"Status": "Success",
|
|
333
202
|
"Code": response.status,
|
|
334
203
|
"Message": "Item created successfully",
|
|
335
204
|
};
|
|
336
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
337
|
-
console.log('Item Service Client: Item created successfully', JSON.stringify({
|
|
338
|
-
parentPath,
|
|
339
|
-
itemName: data.ItemName,
|
|
340
|
-
templateId: data.TemplateID,
|
|
341
|
-
result
|
|
342
|
-
}, null, '\t'));
|
|
343
|
-
}
|
|
344
|
-
return result;
|
|
345
205
|
}
|
|
346
206
|
catch (error) {
|
|
347
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
348
|
-
console.error('Item Service Client: Failed to create item', JSON.stringify({
|
|
349
|
-
parentPath,
|
|
350
|
-
data,
|
|
351
|
-
error
|
|
352
|
-
}, null, '\t'));
|
|
353
|
-
}
|
|
354
207
|
if (error instanceof Error) {
|
|
355
208
|
throw new Error(`Failed to create item: ${error.message}`);
|
|
356
209
|
}
|
|
@@ -372,14 +225,6 @@ class RestfulItemServiceClient {
|
|
|
372
225
|
}
|
|
373
226
|
const params = new URLSearchParams(options);
|
|
374
227
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/${id}?${params.toString()}`;
|
|
375
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
376
|
-
console.log('Item Service Client: Editing item...', JSON.stringify({
|
|
377
|
-
id,
|
|
378
|
-
data,
|
|
379
|
-
options,
|
|
380
|
-
url
|
|
381
|
-
}, null, '\t'));
|
|
382
|
-
}
|
|
383
228
|
try {
|
|
384
229
|
const response = await fetch(url, {
|
|
385
230
|
method: 'PATCH',
|
|
@@ -389,36 +234,16 @@ class RestfulItemServiceClient {
|
|
|
389
234
|
},
|
|
390
235
|
body: JSON.stringify(data)
|
|
391
236
|
});
|
|
392
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
393
|
-
console.log('Item Service Client: Edit item response received', JSON.stringify({
|
|
394
|
-
status: response.status,
|
|
395
|
-
statusText: response.statusText
|
|
396
|
-
}, null, '\t'));
|
|
397
|
-
}
|
|
398
237
|
if (!response.ok) {
|
|
399
238
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
400
239
|
}
|
|
401
|
-
|
|
240
|
+
return {
|
|
402
241
|
"Status": "Success",
|
|
403
242
|
"Code": response.status,
|
|
404
243
|
"Message": "Item updated successfully",
|
|
405
244
|
};
|
|
406
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
407
|
-
console.log('Item Service Client: Item edited successfully', JSON.stringify({
|
|
408
|
-
id,
|
|
409
|
-
result
|
|
410
|
-
}, null, '\t'));
|
|
411
|
-
}
|
|
412
|
-
return result;
|
|
413
245
|
}
|
|
414
246
|
catch (error) {
|
|
415
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
416
|
-
console.error('Item Service Client: Failed to edit item', JSON.stringify({
|
|
417
|
-
id,
|
|
418
|
-
data,
|
|
419
|
-
error
|
|
420
|
-
}, null, '\t'));
|
|
421
|
-
}
|
|
422
247
|
if (error instanceof Error) {
|
|
423
248
|
throw new Error(`Failed to edit item: ${error.message}`);
|
|
424
249
|
}
|
|
@@ -439,13 +264,6 @@ class RestfulItemServiceClient {
|
|
|
439
264
|
}
|
|
440
265
|
const params = new URLSearchParams(options);
|
|
441
266
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/${id}?${params.toString()}`;
|
|
442
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
443
|
-
console.log('Item Service Client: Deleting item...', JSON.stringify({
|
|
444
|
-
id,
|
|
445
|
-
options,
|
|
446
|
-
url
|
|
447
|
-
}, null, '\t'));
|
|
448
|
-
}
|
|
449
267
|
try {
|
|
450
268
|
const response = await fetch(url, {
|
|
451
269
|
method: 'DELETE',
|
|
@@ -453,35 +271,16 @@ class RestfulItemServiceClient {
|
|
|
453
271
|
'Cookie': `.AspNet.Cookies=${this.authCookie}`
|
|
454
272
|
}
|
|
455
273
|
});
|
|
456
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
457
|
-
console.log('Item Service Client: Delete item response received', JSON.stringify({
|
|
458
|
-
status: response.status,
|
|
459
|
-
statusText: response.statusText
|
|
460
|
-
}, null, '\t'));
|
|
461
|
-
}
|
|
462
274
|
if (!response.ok) {
|
|
463
275
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
464
276
|
}
|
|
465
|
-
|
|
277
|
+
return {
|
|
466
278
|
"Status": "Success",
|
|
467
279
|
"Code": response.status,
|
|
468
280
|
"Message": "Item deleted successfully",
|
|
469
281
|
};
|
|
470
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
471
|
-
console.log('Item Service Client: Item deleted successfully', JSON.stringify({
|
|
472
|
-
id,
|
|
473
|
-
result
|
|
474
|
-
}, null, '\t'));
|
|
475
|
-
}
|
|
476
|
-
return result;
|
|
477
282
|
}
|
|
478
283
|
catch (error) {
|
|
479
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
480
|
-
console.error('Item Service Client: Failed to delete item', JSON.stringify({
|
|
481
|
-
id,
|
|
482
|
-
error
|
|
483
|
-
}, null, '\t'));
|
|
484
|
-
}
|
|
485
284
|
if (error instanceof Error) {
|
|
486
285
|
throw new Error(`Failed to delete item: ${error.message}`);
|
|
487
286
|
}
|
|
@@ -515,41 +314,16 @@ class RestfulItemServiceClient {
|
|
|
515
314
|
if (options.includeStandardTemplateFields !== undefined)
|
|
516
315
|
params.set('includeStandardTemplateFields', String(options.includeStandardTemplateFields));
|
|
517
316
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/search?${params.toString()}`;
|
|
518
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
519
|
-
console.log('Item Service Client: Searching items...', JSON.stringify({
|
|
520
|
-
options,
|
|
521
|
-
url
|
|
522
|
-
}, null, '\t'));
|
|
523
|
-
}
|
|
524
317
|
try {
|
|
525
318
|
const response = await fetch(url, {
|
|
526
319
|
headers: { 'Cookie': `.AspNet.Cookies=${this.authCookie}` }
|
|
527
320
|
});
|
|
528
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
529
|
-
console.log('Item Service Client: Search items response received', JSON.stringify({
|
|
530
|
-
status: response.status,
|
|
531
|
-
statusText: response.statusText
|
|
532
|
-
}, null, '\t'));
|
|
533
|
-
}
|
|
534
321
|
if (!response.ok) {
|
|
535
322
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
536
323
|
}
|
|
537
|
-
|
|
538
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
539
|
-
console.log('Item Service Client: Search completed successfully', JSON.stringify({
|
|
540
|
-
searchTerm: options.term,
|
|
541
|
-
resultKeys: Object.keys(result)
|
|
542
|
-
}, null, '\t'));
|
|
543
|
-
}
|
|
544
|
-
return result;
|
|
324
|
+
return await response.json();
|
|
545
325
|
}
|
|
546
326
|
catch (error) {
|
|
547
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
548
|
-
console.error('Item Service Client: Failed to search items', JSON.stringify({
|
|
549
|
-
options,
|
|
550
|
-
error
|
|
551
|
-
}, null, '\t'));
|
|
552
|
-
}
|
|
553
327
|
if (error instanceof Error) {
|
|
554
328
|
throw new Error(`Failed to search items: ${error.message}`);
|
|
555
329
|
}
|
|
@@ -584,43 +358,16 @@ class RestfulItemServiceClient {
|
|
|
584
358
|
if (options.includeStandardTemplateFields !== undefined)
|
|
585
359
|
params.set('includeStandardTemplateFields', String(options.includeStandardTemplateFields));
|
|
586
360
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/${id}/query?${params.toString()}`;
|
|
587
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
588
|
-
console.log('Item Service Client: Running stored query...', JSON.stringify({
|
|
589
|
-
id,
|
|
590
|
-
options,
|
|
591
|
-
url
|
|
592
|
-
}, null, '\t'));
|
|
593
|
-
}
|
|
594
361
|
try {
|
|
595
362
|
const response = await fetch(url, {
|
|
596
363
|
headers: { 'Cookie': `.AspNet.Cookies=${this.authCookie}` }
|
|
597
364
|
});
|
|
598
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
599
|
-
console.log('Item Service Client: Stored query response received', JSON.stringify({
|
|
600
|
-
status: response.status,
|
|
601
|
-
statusText: response.statusText
|
|
602
|
-
}, null, '\t'));
|
|
603
|
-
}
|
|
604
365
|
if (!response.ok) {
|
|
605
366
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
606
367
|
}
|
|
607
|
-
|
|
608
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
609
|
-
console.log('Item Service Client: Stored query completed successfully', JSON.stringify({
|
|
610
|
-
queryId: id,
|
|
611
|
-
resultKeys: Object.keys(result)
|
|
612
|
-
}, null, '\t'));
|
|
613
|
-
}
|
|
614
|
-
return result;
|
|
368
|
+
return await response.json();
|
|
615
369
|
}
|
|
616
370
|
catch (error) {
|
|
617
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
618
|
-
console.error('Item Service Client: Failed to run stored query', JSON.stringify({
|
|
619
|
-
id,
|
|
620
|
-
options,
|
|
621
|
-
error
|
|
622
|
-
}, null, '\t'));
|
|
623
|
-
}
|
|
624
371
|
if (error instanceof Error) {
|
|
625
372
|
throw new Error(`Failed to run stored query: ${error.message}`);
|
|
626
373
|
}
|
|
@@ -658,46 +405,16 @@ class RestfulItemServiceClient {
|
|
|
658
405
|
if (options.sorting)
|
|
659
406
|
params.set('sorting', options.sorting);
|
|
660
407
|
const url = `${this.serverUrl}/sitecore/api/ssc/item/${id}/search?${params.toString()}`;
|
|
661
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
662
|
-
console.log('Item Service Client: Running stored search...', JSON.stringify({
|
|
663
|
-
id,
|
|
664
|
-
term,
|
|
665
|
-
options,
|
|
666
|
-
url
|
|
667
|
-
}, null, '\t'));
|
|
668
|
-
}
|
|
669
408
|
try {
|
|
670
409
|
const response = await fetch(url, {
|
|
671
410
|
headers: { 'Cookie': `.AspNet.Cookies=${this.authCookie}` }
|
|
672
411
|
});
|
|
673
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
674
|
-
console.log('Item Service Client: Stored search response received', JSON.stringify({
|
|
675
|
-
status: response.status,
|
|
676
|
-
statusText: response.statusText
|
|
677
|
-
}, null, '\t'));
|
|
678
|
-
}
|
|
679
412
|
if (!response.ok) {
|
|
680
413
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
681
414
|
}
|
|
682
|
-
|
|
683
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
684
|
-
console.log('Item Service Client: Stored search completed successfully', JSON.stringify({
|
|
685
|
-
searchId: id,
|
|
686
|
-
term,
|
|
687
|
-
resultKeys: Object.keys(result)
|
|
688
|
-
}, null, '\t'));
|
|
689
|
-
}
|
|
690
|
-
return result;
|
|
415
|
+
return await response.json();
|
|
691
416
|
}
|
|
692
417
|
catch (error) {
|
|
693
|
-
if (this.logLevel === LogLevel.DEBUG) {
|
|
694
|
-
console.error('Item Service Client: Failed to run stored search', JSON.stringify({
|
|
695
|
-
id,
|
|
696
|
-
term,
|
|
697
|
-
options,
|
|
698
|
-
error
|
|
699
|
-
}, null, '\t'));
|
|
700
|
-
}
|
|
701
418
|
if (error instanceof Error) {
|
|
702
419
|
throw new Error(`Failed to run stored search: ${error.message}`);
|
|
703
420
|
}
|