pulsemcp-cms-admin-mcp-server 0.9.13 → 0.9.15
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 +15 -8
- package/build/shared/src/pulsemcp-admin-client/lib/add-official-mirror-to-regular-queue.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/admin-fetch.js +33 -0
- package/build/shared/src/pulsemcp-admin-client/lib/approve-official-mirror-queue-item-without-modifying.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/approve-official-mirror-queue-item.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/cleanup-good-jobs.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/create-api-key.js +51 -0
- package/build/shared/src/pulsemcp-admin-client/lib/create-mcp-implementation.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/create-mcp-json.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/create-post.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/create-redirect.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/create-tenant.js +35 -0
- package/build/shared/src/pulsemcp-admin-client/lib/create-unofficial-mirror.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/delete-mcp-json.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/delete-redirect.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/delete-unofficial-mirror.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/discard-good-job.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/force-trigger-good-job-cron.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-author-by-id.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-author-by-slug.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-authors.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-discovered-url-stats.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-discovered-urls.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-draft-mcp-implementations.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-good-job-cron-schedules.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-good-job-processes.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-good-job-statistics.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-good-job.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-good-jobs.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-mcp-client-by-id.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-mcp-client-by-slug.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-mcp-implementation-by-id.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-mcp-json.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-mcp-jsons.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-mcp-server-by-id.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-mcp-server-by-slug.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-moz-backlinks.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-moz-metrics.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-moz-stored-metrics.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-official-mirror-queue-item.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-official-mirror-queue-items.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-official-mirror.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-official-mirrors.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-post.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-posts.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-proctor-metadata.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-proctor-runs.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-provider-by-id.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-redirect.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-redirects.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-tenant.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-tenants.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-unified-mcp-server.js +3 -2
- package/build/shared/src/pulsemcp-admin-client/lib/get-unified-mcp-servers.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-unofficial-mirror.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/get-unofficial-mirrors.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/mark-discovered-url-processed.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/recache-mcp-server.js +24 -0
- package/build/shared/src/pulsemcp-admin-client/lib/reject-official-mirror-queue-item.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/reschedule-good-job.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/retry-good-job.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/run-exam-for-mirror.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/save-mcp-implementation.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/save-results-for-mirror.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/search-mcp-implementations.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/search-providers.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/send-email.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/unlink-official-mirror-queue-item.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/update-mcp-json.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/update-post.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/update-redirect.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/update-unofficial-mirror.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/lib/upload-image.js +2 -1
- package/build/shared/src/pulsemcp-admin-client/pulsemcp-admin-client.integration-mock.js +27 -0
- package/build/shared/src/server.js +13 -1
- package/build/shared/src/tools/create-api-key.js +78 -0
- package/build/shared/src/tools/create-tenant.js +58 -0
- package/build/shared/src/tools/recache-mcp-server.js +49 -0
- package/build/shared/src/tools.js +13 -2
- package/package.json +2 -2
- package/shared/pulsemcp-admin-client/lib/add-official-mirror-to-regular-queue.js +2 -1
- package/shared/pulsemcp-admin-client/lib/admin-fetch.d.ts +6 -0
- package/shared/pulsemcp-admin-client/lib/admin-fetch.js +33 -0
- package/shared/pulsemcp-admin-client/lib/approve-official-mirror-queue-item-without-modifying.js +2 -1
- package/shared/pulsemcp-admin-client/lib/approve-official-mirror-queue-item.js +2 -1
- package/shared/pulsemcp-admin-client/lib/cleanup-good-jobs.js +2 -1
- package/shared/pulsemcp-admin-client/lib/create-api-key.d.ts +3 -0
- package/shared/pulsemcp-admin-client/lib/create-api-key.js +51 -0
- package/shared/pulsemcp-admin-client/lib/create-mcp-implementation.js +2 -1
- package/shared/pulsemcp-admin-client/lib/create-mcp-json.js +2 -1
- package/shared/pulsemcp-admin-client/lib/create-post.js +2 -1
- package/shared/pulsemcp-admin-client/lib/create-redirect.js +2 -1
- package/shared/pulsemcp-admin-client/lib/create-tenant.d.ts +3 -0
- package/shared/pulsemcp-admin-client/lib/create-tenant.js +35 -0
- package/shared/pulsemcp-admin-client/lib/create-unofficial-mirror.js +2 -1
- package/shared/pulsemcp-admin-client/lib/delete-mcp-json.js +2 -1
- package/shared/pulsemcp-admin-client/lib/delete-redirect.js +2 -1
- package/shared/pulsemcp-admin-client/lib/delete-unofficial-mirror.js +2 -1
- package/shared/pulsemcp-admin-client/lib/discard-good-job.js +2 -1
- package/shared/pulsemcp-admin-client/lib/force-trigger-good-job-cron.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-author-by-id.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-author-by-slug.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-authors.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-discovered-url-stats.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-discovered-urls.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-draft-mcp-implementations.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-good-job-cron-schedules.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-good-job-processes.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-good-job-statistics.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-good-job.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-good-jobs.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-mcp-client-by-id.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-mcp-client-by-slug.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-mcp-implementation-by-id.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-mcp-json.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-mcp-jsons.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-mcp-server-by-id.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-mcp-server-by-slug.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-moz-backlinks.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-moz-metrics.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-moz-stored-metrics.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-official-mirror-queue-item.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-official-mirror-queue-items.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-official-mirror.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-official-mirrors.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-post.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-posts.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-proctor-metadata.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-proctor-runs.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-provider-by-id.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-redirect.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-redirects.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-tenant.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-tenants.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-unified-mcp-server.js +3 -2
- package/shared/pulsemcp-admin-client/lib/get-unified-mcp-servers.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-unofficial-mirror.js +2 -1
- package/shared/pulsemcp-admin-client/lib/get-unofficial-mirrors.js +2 -1
- package/shared/pulsemcp-admin-client/lib/mark-discovered-url-processed.js +2 -1
- package/shared/pulsemcp-admin-client/lib/recache-mcp-server.d.ts +3 -0
- package/shared/pulsemcp-admin-client/lib/recache-mcp-server.js +24 -0
- package/shared/pulsemcp-admin-client/lib/reject-official-mirror-queue-item.js +2 -1
- package/shared/pulsemcp-admin-client/lib/reschedule-good-job.js +2 -1
- package/shared/pulsemcp-admin-client/lib/retry-good-job.js +2 -1
- package/shared/pulsemcp-admin-client/lib/run-exam-for-mirror.js +2 -1
- package/shared/pulsemcp-admin-client/lib/save-mcp-implementation.js +2 -1
- package/shared/pulsemcp-admin-client/lib/save-results-for-mirror.js +2 -1
- package/shared/pulsemcp-admin-client/lib/search-mcp-implementations.js +2 -1
- package/shared/pulsemcp-admin-client/lib/search-providers.js +2 -1
- package/shared/pulsemcp-admin-client/lib/send-email.js +2 -1
- package/shared/pulsemcp-admin-client/lib/unlink-official-mirror-queue-item.js +2 -1
- package/shared/pulsemcp-admin-client/lib/update-mcp-json.js +2 -1
- package/shared/pulsemcp-admin-client/lib/update-post.js +2 -1
- package/shared/pulsemcp-admin-client/lib/update-redirect.js +2 -1
- package/shared/pulsemcp-admin-client/lib/update-unofficial-mirror.js +2 -1
- package/shared/pulsemcp-admin-client/lib/upload-image.js +2 -1
- package/shared/pulsemcp-admin-client/pulsemcp-admin-client.integration-mock.js +27 -0
- package/shared/server.d.ts +18 -1
- package/shared/server.js +13 -1
- package/shared/tools/create-api-key.d.ts +39 -0
- package/shared/tools/create-api-key.js +78 -0
- package/shared/tools/create-tenant.d.ts +30 -0
- package/shared/tools/create-tenant.js +58 -0
- package/shared/tools/recache-mcp-server.d.ts +30 -0
- package/shared/tools/recache-mcp-server.js +49 -0
- package/shared/tools.d.ts +2 -1
- package/shared/tools.js +13 -2
- package/shared/types.d.ts +22 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getMozMetrics(apiKey, baseUrl, params) {
|
|
2
3
|
const apiUrl = new URL('/api/moz/metrics', baseUrl);
|
|
3
4
|
apiUrl.searchParams.append('url', params.url);
|
|
4
5
|
if (params.scope) {
|
|
5
6
|
apiUrl.searchParams.append('scope', params.scope);
|
|
6
7
|
}
|
|
7
|
-
const response = await
|
|
8
|
+
const response = await adminFetch(apiUrl.toString(), {
|
|
8
9
|
method: 'GET',
|
|
9
10
|
headers: {
|
|
10
11
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getMozStoredMetrics(apiKey, baseUrl, params) {
|
|
2
3
|
const apiUrl = new URL('/api/moz/stored_metrics', baseUrl);
|
|
3
4
|
apiUrl.searchParams.append('server_id', params.server_id);
|
|
@@ -10,7 +11,7 @@ export async function getMozStoredMetrics(apiKey, baseUrl, params) {
|
|
|
10
11
|
if (params.offset !== undefined) {
|
|
11
12
|
apiUrl.searchParams.append('offset', params.offset.toString());
|
|
12
13
|
}
|
|
13
|
-
const response = await
|
|
14
|
+
const response = await adminFetch(apiUrl.toString(), {
|
|
14
15
|
method: 'GET',
|
|
15
16
|
headers: {
|
|
16
17
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapMirror(mirror) {
|
|
2
3
|
return {
|
|
3
4
|
id: mirror.id,
|
|
@@ -34,7 +35,7 @@ function mapLinkedServer(server) {
|
|
|
34
35
|
}
|
|
35
36
|
export async function getOfficialMirrorQueueItem(apiKey, baseUrl, id) {
|
|
36
37
|
const url = new URL(`/api/official_mirror_queues/${id}`, baseUrl);
|
|
37
|
-
const response = await
|
|
38
|
+
const response = await adminFetch(url.toString(), {
|
|
38
39
|
method: 'GET',
|
|
39
40
|
headers: {
|
|
40
41
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapMirrorSummary(mirror) {
|
|
2
3
|
if (!mirror)
|
|
3
4
|
return null;
|
|
@@ -39,7 +40,7 @@ export async function getOfficialMirrorQueueItems(apiKey, baseUrl, params) {
|
|
|
39
40
|
if (params?.offset) {
|
|
40
41
|
url.searchParams.append('offset', params.offset.toString());
|
|
41
42
|
}
|
|
42
|
-
const response = await
|
|
43
|
+
const response = await adminFetch(url.toString(), {
|
|
43
44
|
method: 'GET',
|
|
44
45
|
headers: {
|
|
45
46
|
'X-API-Key': apiKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getOfficialMirror(apiKey, baseUrl, id) {
|
|
2
3
|
const url = new URL(`/api/official_mirrors/${id}`, baseUrl);
|
|
3
|
-
const response = await
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
4
5
|
method: 'GET',
|
|
5
6
|
headers: {
|
|
6
7
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapMirror(mirror) {
|
|
2
3
|
return {
|
|
3
4
|
id: mirror.id,
|
|
@@ -36,7 +37,7 @@ export async function getOfficialMirrors(apiKey, baseUrl, params) {
|
|
|
36
37
|
if (params?.offset) {
|
|
37
38
|
url.searchParams.append('offset', params.offset.toString());
|
|
38
39
|
}
|
|
39
|
-
const response = await
|
|
40
|
+
const response = await adminFetch(url.toString(), {
|
|
40
41
|
method: 'GET',
|
|
41
42
|
headers: {
|
|
42
43
|
'X-API-Key': apiKey,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getPost(apiKey, baseUrl, slug) {
|
|
2
3
|
// Use the supervisor endpoint which supports JSON and returns full post data including body
|
|
3
4
|
const url = new URL(`/supervisor/posts/${slug}`, baseUrl);
|
|
4
|
-
const response = await
|
|
5
|
+
const response = await adminFetch(url.toString(), {
|
|
5
6
|
method: 'GET',
|
|
6
7
|
headers: {
|
|
7
8
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getPosts(apiKey, baseUrl, params) {
|
|
2
3
|
const url = new URL('/posts', baseUrl);
|
|
3
4
|
// Add query parameters if provided
|
|
@@ -13,7 +14,7 @@ export async function getPosts(apiKey, baseUrl, params) {
|
|
|
13
14
|
if (params?.page) {
|
|
14
15
|
url.searchParams.append('page', params.page.toString());
|
|
15
16
|
}
|
|
16
|
-
const response = await
|
|
17
|
+
const response = await adminFetch(url.toString(), {
|
|
17
18
|
method: 'GET',
|
|
18
19
|
headers: {
|
|
19
20
|
'X-API-Key': apiKey,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
/**
|
|
2
3
|
* Get available runtimes and exams from the Proctor API
|
|
3
4
|
*/
|
|
4
5
|
export async function getProctorMetadata(apiKey, baseUrl) {
|
|
5
6
|
const url = new URL('/api/proctor/metadata', baseUrl);
|
|
6
|
-
const response = await
|
|
7
|
+
const response = await adminFetch(url.toString(), {
|
|
7
8
|
method: 'GET',
|
|
8
9
|
headers: {
|
|
9
10
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getProctorRuns(apiKey, baseUrl, params) {
|
|
2
3
|
const url = new URL('/api/proctor_runs', baseUrl);
|
|
3
4
|
if (params?.q) {
|
|
@@ -21,7 +22,7 @@ export async function getProctorRuns(apiKey, baseUrl, params) {
|
|
|
21
22
|
if (params?.offset !== undefined && params.offset > 0) {
|
|
22
23
|
url.searchParams.append('offset', params.offset.toString());
|
|
23
24
|
}
|
|
24
|
-
const response = await
|
|
25
|
+
const response = await adminFetch(url.toString(), {
|
|
25
26
|
method: 'GET',
|
|
26
27
|
headers: {
|
|
27
28
|
'X-API-Key': apiKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getProviderById(apiKey, baseUrl, id) {
|
|
2
3
|
const url = new URL(`/api/providers/${id}`, baseUrl);
|
|
3
|
-
const response = await
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
4
5
|
method: 'GET',
|
|
5
6
|
headers: {
|
|
6
7
|
'X-API-Key': apiKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getRedirect(apiKey, baseUrl, id) {
|
|
2
3
|
const url = new URL(`/api/redirects/${id}`, baseUrl);
|
|
3
|
-
const response = await
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
4
5
|
method: 'GET',
|
|
5
6
|
headers: {
|
|
6
7
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapRedirect(redirect) {
|
|
2
3
|
return {
|
|
3
4
|
id: redirect.id,
|
|
@@ -22,7 +23,7 @@ export async function getRedirects(apiKey, baseUrl, params) {
|
|
|
22
23
|
if (params?.offset) {
|
|
23
24
|
url.searchParams.append('offset', params.offset.toString());
|
|
24
25
|
}
|
|
25
|
-
const response = await
|
|
26
|
+
const response = await adminFetch(url.toString(), {
|
|
26
27
|
method: 'GET',
|
|
27
28
|
headers: {
|
|
28
29
|
'X-API-Key': apiKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getTenant(apiKey, baseUrl, idOrSlug) {
|
|
2
3
|
const url = new URL(`/api/tenants/${idOrSlug}`, baseUrl);
|
|
3
|
-
const response = await
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
4
5
|
method: 'GET',
|
|
5
6
|
headers: {
|
|
6
7
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapTenant(tenant) {
|
|
2
3
|
return {
|
|
3
4
|
id: tenant.id,
|
|
@@ -22,7 +23,7 @@ export async function getTenants(apiKey, baseUrl, params) {
|
|
|
22
23
|
if (params?.offset) {
|
|
23
24
|
url.searchParams.append('offset', params.offset.toString());
|
|
24
25
|
}
|
|
25
|
-
const response = await
|
|
26
|
+
const response = await adminFetch(url.toString(), {
|
|
26
27
|
method: 'GET',
|
|
27
28
|
headers: {
|
|
28
29
|
'X-API-Key': apiKey,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mapToUnifiedServer } from './unified-mcp-server-mapper.js';
|
|
2
|
+
import { adminFetch } from './admin-fetch.js';
|
|
2
3
|
/**
|
|
3
4
|
* Get a unified MCP server by its slug.
|
|
4
5
|
* This fetches the MCPServer and its associated MCPImplementation data.
|
|
@@ -6,7 +7,7 @@ import { mapToUnifiedServer } from './unified-mcp-server-mapper.js';
|
|
|
6
7
|
export async function getUnifiedMCPServer(apiKey, baseUrl, slug) {
|
|
7
8
|
// First, get the MCPServer to get its ID
|
|
8
9
|
const serverUrl = new URL(`/supervisor/mcp_servers/${slug}`, baseUrl);
|
|
9
|
-
const serverResponse = await
|
|
10
|
+
const serverResponse = await adminFetch(serverUrl.toString(), {
|
|
10
11
|
method: 'GET',
|
|
11
12
|
headers: {
|
|
12
13
|
'X-API-Key': apiKey,
|
|
@@ -33,7 +34,7 @@ export async function getUnifiedMCPServer(apiKey, baseUrl, slug) {
|
|
|
33
34
|
searchUrl.searchParams.append('q', slug);
|
|
34
35
|
searchUrl.searchParams.append('type', 'server');
|
|
35
36
|
searchUrl.searchParams.append('limit', '50');
|
|
36
|
-
const searchResponse = await
|
|
37
|
+
const searchResponse = await adminFetch(searchUrl.toString(), {
|
|
37
38
|
method: 'GET',
|
|
38
39
|
headers: {
|
|
39
40
|
'X-API-Key': apiKey,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { mapToUnifiedServer } from './unified-mcp-server-mapper.js';
|
|
2
|
+
import { adminFetch } from './admin-fetch.js';
|
|
2
3
|
export async function getUnifiedMCPServers(apiKey, baseUrl, params) {
|
|
3
4
|
const url = new URL('/api/implementations/search', baseUrl);
|
|
4
5
|
// Always filter to servers only
|
|
@@ -17,7 +18,7 @@ export async function getUnifiedMCPServers(apiKey, baseUrl, params) {
|
|
|
17
18
|
if (params?.offset) {
|
|
18
19
|
url.searchParams.append('offset', params.offset.toString());
|
|
19
20
|
}
|
|
20
|
-
const response = await
|
|
21
|
+
const response = await adminFetch(url.toString(), {
|
|
21
22
|
method: 'GET',
|
|
22
23
|
headers: {
|
|
23
24
|
'X-API-Key': apiKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function getUnofficialMirror(apiKey, baseUrl, id) {
|
|
2
3
|
const url = new URL(`/api/unofficial_mirrors/${id}`, baseUrl);
|
|
3
|
-
const response = await
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
4
5
|
method: 'GET',
|
|
5
6
|
headers: {
|
|
6
7
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapMirror(mirror) {
|
|
2
3
|
return {
|
|
3
4
|
id: mirror.id,
|
|
@@ -29,7 +30,7 @@ export async function getUnofficialMirrors(apiKey, baseUrl, params) {
|
|
|
29
30
|
if (params?.offset) {
|
|
30
31
|
url.searchParams.append('offset', params.offset.toString());
|
|
31
32
|
}
|
|
32
|
-
const response = await
|
|
33
|
+
const response = await adminFetch(url.toString(), {
|
|
33
34
|
method: 'GET',
|
|
34
35
|
headers: {
|
|
35
36
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function markDiscoveredUrlProcessed(apiKey, baseUrl, params) {
|
|
2
3
|
const url = new URL(`/api/discovered_urls/${params.id}/mark_processed`, baseUrl);
|
|
3
4
|
const body = {
|
|
@@ -9,7 +10,7 @@ export async function markDiscoveredUrlProcessed(apiKey, baseUrl, params) {
|
|
|
9
10
|
if (params.mcp_implementation_id !== undefined) {
|
|
10
11
|
body.mcp_implementation_id = params.mcp_implementation_id;
|
|
11
12
|
}
|
|
12
|
-
const response = await
|
|
13
|
+
const response = await adminFetch(url.toString(), {
|
|
13
14
|
method: 'POST',
|
|
14
15
|
headers: {
|
|
15
16
|
'X-API-Key': apiKey,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
2
|
+
export async function recacheMCPServer(apiKey, baseUrl, slug) {
|
|
3
|
+
const url = new URL(`/api/mcp_servers/${encodeURIComponent(slug)}/recache`, baseUrl);
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
5
|
+
method: 'POST',
|
|
6
|
+
headers: {
|
|
7
|
+
'X-API-Key': apiKey,
|
|
8
|
+
Accept: 'application/json',
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
if (!response.ok) {
|
|
12
|
+
if (response.status === 401) {
|
|
13
|
+
throw new Error('Invalid API key');
|
|
14
|
+
}
|
|
15
|
+
if (response.status === 403) {
|
|
16
|
+
throw new Error('User lacks write privileges');
|
|
17
|
+
}
|
|
18
|
+
if (response.status === 404) {
|
|
19
|
+
throw new Error(`MCP server not found: ${slug}`);
|
|
20
|
+
}
|
|
21
|
+
throw new Error(`Failed to recache MCP server: ${response.status} ${response.statusText}`);
|
|
22
|
+
}
|
|
23
|
+
return (await response.json());
|
|
24
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapQueueItem(item) {
|
|
2
3
|
return {
|
|
3
4
|
id: item.id,
|
|
@@ -23,7 +24,7 @@ function mapQueueItem(item) {
|
|
|
23
24
|
}
|
|
24
25
|
export async function rejectOfficialMirrorQueueItem(apiKey, baseUrl, id) {
|
|
25
26
|
const url = new URL(`/api/official_mirror_queues/${id}/reject`, baseUrl);
|
|
26
|
-
const response = await
|
|
27
|
+
const response = await adminFetch(url.toString(), {
|
|
27
28
|
method: 'POST',
|
|
28
29
|
headers: {
|
|
29
30
|
'X-API-Key': apiKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function rescheduleGoodJob(apiKey, baseUrl, id, scheduledAt) {
|
|
2
3
|
const url = new URL(`/api/good_jobs/${id}/reschedule`, baseUrl);
|
|
3
|
-
const response = await
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
4
5
|
method: 'POST',
|
|
5
6
|
headers: {
|
|
6
7
|
'X-API-Key': apiKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function retryGoodJob(apiKey, baseUrl, id) {
|
|
2
3
|
const url = new URL(`/api/good_jobs/${id}/retry`, baseUrl);
|
|
3
|
-
const response = await
|
|
4
|
+
const response = await adminFetch(url.toString(), {
|
|
4
5
|
method: 'POST',
|
|
5
6
|
headers: {
|
|
6
7
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function runExamForMirror(apiKey, baseUrl, params) {
|
|
2
3
|
const url = new URL('/api/proctor/run_exam_for_mirror', baseUrl);
|
|
3
4
|
const body = {
|
|
@@ -8,7 +9,7 @@ export async function runExamForMirror(apiKey, baseUrl, params) {
|
|
|
8
9
|
if (params.max_retries !== undefined) {
|
|
9
10
|
body.max_retries = params.max_retries;
|
|
10
11
|
}
|
|
11
|
-
const response = await
|
|
12
|
+
const response = await adminFetch(url.toString(), {
|
|
12
13
|
method: 'POST',
|
|
13
14
|
headers: {
|
|
14
15
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function saveMCPImplementation(apiKey, baseUrl, id, params) {
|
|
2
3
|
const url = new URL(`/api/implementations/${id}`, baseUrl);
|
|
3
4
|
// Build form data for the PUT request
|
|
@@ -163,7 +164,7 @@ export async function saveMCPImplementation(apiKey, baseUrl, id, params) {
|
|
|
163
164
|
formData.append('mcp_implementation[canonical_attributes]', '[]');
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
|
-
const response = await
|
|
167
|
+
const response = await adminFetch(url.toString(), {
|
|
167
168
|
method: 'PUT',
|
|
168
169
|
headers: {
|
|
169
170
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function saveResultsForMirror(apiKey, baseUrl, params) {
|
|
2
3
|
const url = new URL('/api/proctor/save_results_for_mirror', baseUrl);
|
|
3
4
|
const body = {
|
|
@@ -11,7 +12,7 @@ export async function saveResultsForMirror(apiKey, baseUrl, params) {
|
|
|
11
12
|
},
|
|
12
13
|
})),
|
|
13
14
|
};
|
|
14
|
-
const response = await
|
|
15
|
+
const response = await adminFetch(url.toString(), {
|
|
15
16
|
method: 'POST',
|
|
16
17
|
headers: {
|
|
17
18
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function searchMCPImplementations(apiKey, baseUrl, params) {
|
|
2
3
|
// Endpoint implemented at: /api/implementations/search
|
|
3
4
|
// Requires admin authentication via X-API-Key header
|
|
@@ -16,7 +17,7 @@ export async function searchMCPImplementations(apiKey, baseUrl, params) {
|
|
|
16
17
|
if (params.offset) {
|
|
17
18
|
url.searchParams.append('offset', params.offset.toString());
|
|
18
19
|
}
|
|
19
|
-
const response = await
|
|
20
|
+
const response = await adminFetch(url.toString(), {
|
|
20
21
|
method: 'GET',
|
|
21
22
|
headers: {
|
|
22
23
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function searchProviders(apiKey, baseUrl, params) {
|
|
2
3
|
// Endpoint implemented at: /api/providers/search
|
|
3
4
|
// Requires admin authentication via X-API-Key header
|
|
@@ -10,7 +11,7 @@ export async function searchProviders(apiKey, baseUrl, params) {
|
|
|
10
11
|
if (params.offset) {
|
|
11
12
|
url.searchParams.append('offset', params.offset.toString());
|
|
12
13
|
}
|
|
13
|
-
const response = await
|
|
14
|
+
const response = await adminFetch(url.toString(), {
|
|
14
15
|
method: 'GET',
|
|
15
16
|
headers: {
|
|
16
17
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
/**
|
|
2
3
|
* Send an email via the PulseMCP Admin API
|
|
3
4
|
*/
|
|
@@ -11,7 +12,7 @@ export async function sendEmail(apiKey, baseUrl, params) {
|
|
|
11
12
|
formData.append('email[to_email_address]', params.to_email_address);
|
|
12
13
|
formData.append('email[subject]', params.subject);
|
|
13
14
|
formData.append('email[content]', params.content);
|
|
14
|
-
const response = await
|
|
15
|
+
const response = await adminFetch(url.toString(), {
|
|
15
16
|
method: 'POST',
|
|
16
17
|
headers: {
|
|
17
18
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
function mapQueueItem(item) {
|
|
2
3
|
return {
|
|
3
4
|
id: item.id,
|
|
@@ -23,7 +24,7 @@ function mapQueueItem(item) {
|
|
|
23
24
|
}
|
|
24
25
|
export async function unlinkOfficialMirrorQueueItem(apiKey, baseUrl, id) {
|
|
25
26
|
const url = new URL(`/api/official_mirror_queues/${id}/unlink`, baseUrl);
|
|
26
|
-
const response = await
|
|
27
|
+
const response = await adminFetch(url.toString(), {
|
|
27
28
|
method: 'POST',
|
|
28
29
|
headers: {
|
|
29
30
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function updateMcpJson(apiKey, baseUrl, id, params) {
|
|
2
3
|
const url = new URL(`/api/mcp_jsons/${id}`, baseUrl);
|
|
3
4
|
const body = {};
|
|
@@ -13,7 +14,7 @@ export async function updateMcpJson(apiKey, baseUrl, id, params) {
|
|
|
13
14
|
if (params.description !== undefined) {
|
|
14
15
|
body.description = params.description;
|
|
15
16
|
}
|
|
16
|
-
const response = await
|
|
17
|
+
const response = await adminFetch(url.toString(), {
|
|
17
18
|
method: 'PUT',
|
|
18
19
|
headers: {
|
|
19
20
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function updatePost(apiKey, baseUrl, slug, params) {
|
|
2
3
|
const url = new URL(`/posts/${slug}`, baseUrl);
|
|
3
4
|
// Build form data for the PUT request
|
|
@@ -50,7 +51,7 @@ export async function updatePost(apiKey, baseUrl, slug, params) {
|
|
|
50
51
|
formData.append('post[featured_mcp_client_ids][]', id.toString());
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
const response = await
|
|
54
|
+
const response = await adminFetch(url.toString(), {
|
|
54
55
|
method: 'PUT',
|
|
55
56
|
headers: {
|
|
56
57
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function updateRedirect(apiKey, baseUrl, id, params) {
|
|
2
3
|
const url = new URL(`/api/redirects/${id}`, baseUrl);
|
|
3
4
|
const body = {};
|
|
@@ -10,7 +11,7 @@ export async function updateRedirect(apiKey, baseUrl, id, params) {
|
|
|
10
11
|
if (params.status !== undefined) {
|
|
11
12
|
body.status = params.status;
|
|
12
13
|
}
|
|
13
|
-
const response = await
|
|
14
|
+
const response = await adminFetch(url.toString(), {
|
|
14
15
|
method: 'PUT',
|
|
15
16
|
headers: {
|
|
16
17
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function updateUnofficialMirror(apiKey, baseUrl, id, params) {
|
|
2
3
|
const url = new URL(`/api/unofficial_mirrors/${id}`, baseUrl);
|
|
3
4
|
const body = {};
|
|
@@ -20,7 +21,7 @@ export async function updateUnofficialMirror(apiKey, baseUrl, id, params) {
|
|
|
20
21
|
if (params.next_name !== undefined) {
|
|
21
22
|
body.next_name = params.next_name;
|
|
22
23
|
}
|
|
23
|
-
const response = await
|
|
24
|
+
const response = await adminFetch(url.toString(), {
|
|
24
25
|
method: 'PUT',
|
|
25
26
|
headers: {
|
|
26
27
|
'X-API-Key': apiKey,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { adminFetch } from './admin-fetch.js';
|
|
1
2
|
export async function uploadImage(apiKey, baseUrl, postSlug, fileName, fileData) {
|
|
2
3
|
const url = new URL('/upload_image', baseUrl);
|
|
3
4
|
// Create form data for multipart upload
|
|
@@ -9,7 +10,7 @@ export async function uploadImage(apiKey, baseUrl, postSlug, fileName, fileData)
|
|
|
9
10
|
// Add folder and filepath as documented in the API
|
|
10
11
|
formData.append('folder', `posts/${postSlug}`);
|
|
11
12
|
formData.append('filepath', fileName);
|
|
12
|
-
const response = await
|
|
13
|
+
const response = await adminFetch(url.toString(), {
|
|
13
14
|
method: 'POST',
|
|
14
15
|
headers: {
|
|
15
16
|
'X-API-Key': apiKey,
|
|
@@ -1023,5 +1023,32 @@ export function createMockPulseMCPAdminClient(mockData) {
|
|
|
1023
1023
|
},
|
|
1024
1024
|
};
|
|
1025
1025
|
},
|
|
1026
|
+
async createTenant(params) {
|
|
1027
|
+
return {
|
|
1028
|
+
id: 99,
|
|
1029
|
+
slug: params.slug,
|
|
1030
|
+
is_admin: false,
|
|
1031
|
+
enrichments: {},
|
|
1032
|
+
created_at: '2024-01-01T00:00:00Z',
|
|
1033
|
+
updated_at: '2024-01-01T00:00:00Z',
|
|
1034
|
+
};
|
|
1035
|
+
},
|
|
1036
|
+
async createApiKey(params) {
|
|
1037
|
+
return {
|
|
1038
|
+
id: 99,
|
|
1039
|
+
name: params.name,
|
|
1040
|
+
tenant_id: 1,
|
|
1041
|
+
tenant_slug: params.tenant_slug,
|
|
1042
|
+
tenant_is_admin: false,
|
|
1043
|
+
permission_level: (params.permission_level || 'full_access'),
|
|
1044
|
+
key: '00000000-0000-0000-0000-000000000000',
|
|
1045
|
+
created_at: '2024-01-01T00:00:00Z',
|
|
1046
|
+
};
|
|
1047
|
+
},
|
|
1048
|
+
async recacheMCPServer(slug) {
|
|
1049
|
+
return {
|
|
1050
|
+
message: `Cache successfully refreshed for ${slug}.`,
|
|
1051
|
+
};
|
|
1052
|
+
},
|
|
1026
1053
|
};
|
|
1027
1054
|
}
|
|
@@ -71,6 +71,9 @@ import { getDiscoveredUrlStats } from './pulsemcp-admin-client/lib/get-discovere
|
|
|
71
71
|
import { getMozMetrics } from './pulsemcp-admin-client/lib/get-moz-metrics.js';
|
|
72
72
|
import { getMozBacklinks } from './pulsemcp-admin-client/lib/get-moz-backlinks.js';
|
|
73
73
|
import { getMozStoredMetrics } from './pulsemcp-admin-client/lib/get-moz-stored-metrics.js';
|
|
74
|
+
import { recacheMCPServer } from './pulsemcp-admin-client/lib/recache-mcp-server.js';
|
|
75
|
+
import { createTenant } from './pulsemcp-admin-client/lib/create-tenant.js';
|
|
76
|
+
import { createApiKey } from './pulsemcp-admin-client/lib/create-api-key.js';
|
|
74
77
|
// PulseMCP Admin API client implementation
|
|
75
78
|
export class PulseMCPAdminClient {
|
|
76
79
|
apiKey;
|
|
@@ -184,13 +187,19 @@ export class PulseMCPAdminClient {
|
|
|
184
187
|
async getOfficialMirror(id) {
|
|
185
188
|
return getOfficialMirror(this.apiKey, this.baseUrl, id);
|
|
186
189
|
}
|
|
187
|
-
// Tenant REST API methods
|
|
190
|
+
// Tenant REST API methods
|
|
188
191
|
async getTenants(params) {
|
|
189
192
|
return getTenants(this.apiKey, this.baseUrl, params);
|
|
190
193
|
}
|
|
191
194
|
async getTenant(idOrSlug) {
|
|
192
195
|
return getTenant(this.apiKey, this.baseUrl, idOrSlug);
|
|
193
196
|
}
|
|
197
|
+
async createTenant(params) {
|
|
198
|
+
return createTenant(this.apiKey, this.baseUrl, params);
|
|
199
|
+
}
|
|
200
|
+
async createApiKey(params) {
|
|
201
|
+
return createApiKey(this.apiKey, this.baseUrl, params);
|
|
202
|
+
}
|
|
194
203
|
// MCP JSON REST API methods
|
|
195
204
|
async getMcpJsons(params) {
|
|
196
205
|
return getMcpJsons(this.apiKey, this.baseUrl, params);
|
|
@@ -217,6 +226,9 @@ export class PulseMCPAdminClient {
|
|
|
217
226
|
async updateUnifiedMCPServer(implementationId, params) {
|
|
218
227
|
return updateUnifiedMCPServer(this.apiKey, this.baseUrl, implementationId, params);
|
|
219
228
|
}
|
|
229
|
+
async recacheMCPServer(slug) {
|
|
230
|
+
return recacheMCPServer(this.apiKey, this.baseUrl, slug);
|
|
231
|
+
}
|
|
220
232
|
// Redirect REST API methods
|
|
221
233
|
async getRedirects(params) {
|
|
222
234
|
return getRedirects(this.apiKey, this.baseUrl, params);
|