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.
@@ -1,5 +1,5 @@
1
1
  export async function getDiscoveredUrlStats(apiKey, baseUrl) {
2
- const url = new URL('/admin/api/discovered_urls/stats', baseUrl);
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('/admin/api/discovered_urls', baseUrl);
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(`/admin/api/discovered_urls/${params.id}/mark_processed`, baseUrl);
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
- content += `- ${error.exam_id}: ${error.error}\n`;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "pulsemcp-cms-admin-mcp-server",
3
- "version": "0.6.11",
3
+ "version": "0.6.13",
4
4
  "description": "Local implementation of PulseMCP CMS Admin MCP server",
5
5
  "mcpName": "com.pulsemcp.servers/pulsemcp-cms-admin",
6
6
  "main": "build/index.js",
@@ -1,5 +1,5 @@
1
1
  export async function getDiscoveredUrlStats(apiKey, baseUrl) {
2
- const url = new URL('/admin/api/discovered_urls/stats', baseUrl);
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('/admin/api/discovered_urls', baseUrl);
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(`/admin/api/discovered_urls/${params.id}/mark_processed`, baseUrl);
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
- content += `- ${error.exam_id}: ${error.error}\n`;
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/shared/types.d.ts CHANGED
@@ -686,7 +686,7 @@ export interface ProctorSaveResultsResponse {
686
686
  exam_id: string;
687
687
  proctor_result_id: number;
688
688
  }>;
689
- errors: Array<{
689
+ errors: Array<string | {
690
690
  exam_id: string;
691
691
  error: string;
692
692
  }>;