pulsemcp-cms-admin-mcp-server 0.6.11 → 0.6.13
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/build/shared/src/pulsemcp-admin-client/lib/get-discovered-url-stats.js +1 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-discovered-urls.js +1 -1
- package/build/shared/src/pulsemcp-admin-client/lib/mark-discovered-url-processed.js +1 -1
- package/build/shared/src/pulsemcp-admin-client/lib/save-results-for-mirror.js +7 -1
- package/build/shared/src/tools/save-results-for-mirror.js +6 -1
- package/package.json +1 -1
- package/shared/pulsemcp-admin-client/lib/get-discovered-url-stats.js +1 -1
- package/shared/pulsemcp-admin-client/lib/get-discovered-urls.js +1 -1
- package/shared/pulsemcp-admin-client/lib/mark-discovered-url-processed.js +1 -1
- package/shared/pulsemcp-admin-client/lib/save-results-for-mirror.js +7 -1
- package/shared/tools/save-results-for-mirror.js +6 -1
- package/shared/types.d.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function getDiscoveredUrlStats(apiKey, baseUrl) {
|
|
2
|
-
const url = new URL('/
|
|
2
|
+
const url = new URL('/api/discovered_urls/stats', baseUrl);
|
|
3
3
|
const response = await fetch(url.toString(), {
|
|
4
4
|
method: 'GET',
|
|
5
5
|
headers: {
|
|
@@ -9,7 +9,7 @@ function mapDiscoveredUrl(raw) {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export async function getDiscoveredUrls(apiKey, baseUrl, params) {
|
|
12
|
-
const url = new URL('/
|
|
12
|
+
const url = new URL('/api/discovered_urls', baseUrl);
|
|
13
13
|
if (params?.status) {
|
|
14
14
|
url.searchParams.append('status', params.status);
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function markDiscoveredUrlProcessed(apiKey, baseUrl, params) {
|
|
2
|
-
const url = new URL(`/
|
|
2
|
+
const url = new URL(`/api/discovered_urls/${params.id}/mark_processed`, baseUrl);
|
|
3
3
|
const body = {
|
|
4
4
|
result: params.result,
|
|
5
5
|
};
|
|
@@ -3,7 +3,13 @@ export async function saveResultsForMirror(apiKey, baseUrl, params) {
|
|
|
3
3
|
const body = {
|
|
4
4
|
mirror_id: params.mirror_id,
|
|
5
5
|
runtime_id: params.runtime_id,
|
|
6
|
-
results: params.results
|
|
6
|
+
results: params.results.map((r) => ({
|
|
7
|
+
exam_id: r.exam_id,
|
|
8
|
+
result: {
|
|
9
|
+
status: r.status,
|
|
10
|
+
...(r.data && { data: r.data }),
|
|
11
|
+
},
|
|
12
|
+
})),
|
|
7
13
|
};
|
|
8
14
|
const response = await fetch(url.toString(), {
|
|
9
15
|
method: 'POST',
|
|
@@ -78,7 +78,12 @@ Typical workflow:
|
|
|
78
78
|
if (response.errors.length > 0) {
|
|
79
79
|
content += `**Errors (${response.errors.length}):**\n`;
|
|
80
80
|
for (const error of response.errors) {
|
|
81
|
-
|
|
81
|
+
if (typeof error === 'string') {
|
|
82
|
+
content += `- ${error}\n`;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
content += `- ${error.exam_id}: ${error.error}\n`;
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
89
|
return { content: [{ type: 'text', text: content.trim() }] };
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function getDiscoveredUrlStats(apiKey, baseUrl) {
|
|
2
|
-
const url = new URL('/
|
|
2
|
+
const url = new URL('/api/discovered_urls/stats', baseUrl);
|
|
3
3
|
const response = await fetch(url.toString(), {
|
|
4
4
|
method: 'GET',
|
|
5
5
|
headers: {
|
|
@@ -9,7 +9,7 @@ function mapDiscoveredUrl(raw) {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export async function getDiscoveredUrls(apiKey, baseUrl, params) {
|
|
12
|
-
const url = new URL('/
|
|
12
|
+
const url = new URL('/api/discovered_urls', baseUrl);
|
|
13
13
|
if (params?.status) {
|
|
14
14
|
url.searchParams.append('status', params.status);
|
|
15
15
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export async function markDiscoveredUrlProcessed(apiKey, baseUrl, params) {
|
|
2
|
-
const url = new URL(`/
|
|
2
|
+
const url = new URL(`/api/discovered_urls/${params.id}/mark_processed`, baseUrl);
|
|
3
3
|
const body = {
|
|
4
4
|
result: params.result,
|
|
5
5
|
};
|
|
@@ -3,7 +3,13 @@ export async function saveResultsForMirror(apiKey, baseUrl, params) {
|
|
|
3
3
|
const body = {
|
|
4
4
|
mirror_id: params.mirror_id,
|
|
5
5
|
runtime_id: params.runtime_id,
|
|
6
|
-
results: params.results
|
|
6
|
+
results: params.results.map((r) => ({
|
|
7
|
+
exam_id: r.exam_id,
|
|
8
|
+
result: {
|
|
9
|
+
status: r.status,
|
|
10
|
+
...(r.data && { data: r.data }),
|
|
11
|
+
},
|
|
12
|
+
})),
|
|
7
13
|
};
|
|
8
14
|
const response = await fetch(url.toString(), {
|
|
9
15
|
method: 'POST',
|
|
@@ -78,7 +78,12 @@ Typical workflow:
|
|
|
78
78
|
if (response.errors.length > 0) {
|
|
79
79
|
content += `**Errors (${response.errors.length}):**\n`;
|
|
80
80
|
for (const error of response.errors) {
|
|
81
|
-
|
|
81
|
+
if (typeof error === 'string') {
|
|
82
|
+
content += `- ${error}\n`;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
content += `- ${error.exam_id}: ${error.error}\n`;
|
|
86
|
+
}
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
89
|
return { content: [{ type: 'text', text: content.trim() }] };
|