mirror of
https://github.com/modelcontextprotocol/servers.git
synced 2026-04-20 12:55:21 +02:00
cleanup
This commit is contained in:
committed by
Peter M. Elias
parent
a79ec67d9c
commit
7c72d987f9
@@ -1,6 +1,6 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { githubRequest } from "../common/utils";
|
import { githubRequest } from "../common/utils.js";
|
||||||
import { GitHubReferenceSchema } from "../common/types";
|
import { GitHubReferenceSchema } from "../common/types.js";
|
||||||
|
|
||||||
// Schema definitions
|
// Schema definitions
|
||||||
export const CreateBranchOptionsSchema = z.object({
|
export const CreateBranchOptionsSchema = z.object({
|
||||||
@@ -109,4 +109,4 @@ export async function updateBranch(
|
|||||||
);
|
);
|
||||||
|
|
||||||
return GitHubReferenceSchema.parse(response);
|
return GitHubReferenceSchema.parse(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { githubRequest, buildUrl } from "../common/utils";
|
import { githubRequest, buildUrl } from "../common/utils.js";
|
||||||
import { GitHubCommitSchema, GitHubListCommitsSchema } from "../common/types";
|
import { GitHubCommitSchema, GitHubListCommitsSchema } from "../common/types.js";
|
||||||
|
|
||||||
// Schema definitions
|
// Schema definitions
|
||||||
export const ListCommitsSchema = z.object({
|
export const ListCommitsSchema = z.object({
|
||||||
@@ -92,4 +92,4 @@ export async function compareCommits(
|
|||||||
ahead_by: z.number(),
|
ahead_by: z.number(),
|
||||||
behind_by: z.number(),
|
behind_by: z.number(),
|
||||||
}).parse(response);
|
}).parse(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { githubRequest } from "../common/utils";
|
import { githubRequest } from "../common/utils.js";
|
||||||
import {
|
import {
|
||||||
GitHubContentSchema,
|
GitHubContentSchema,
|
||||||
GitHubAuthorSchema,
|
GitHubAuthorSchema,
|
||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
GitHubCommitSchema,
|
GitHubCommitSchema,
|
||||||
GitHubReferenceSchema,
|
GitHubReferenceSchema,
|
||||||
GitHubFileContentSchema,
|
GitHubFileContentSchema,
|
||||||
} from "../common/types";
|
} from "../common/types.js";
|
||||||
|
|
||||||
// Schema definitions
|
// Schema definitions
|
||||||
export const FileOperationSchema = z.object({
|
export const FileOperationSchema = z.object({
|
||||||
@@ -216,4 +216,4 @@ export async function pushFiles(
|
|||||||
const tree = await createTree(owner, repo, files, commitSha);
|
const tree = await createTree(owner, repo, files, commitSha);
|
||||||
const commit = await createCommit(owner, repo, message, tree.sha, [commitSha]);
|
const commit = await createCommit(owner, repo, message, tree.sha, [commitSha]);
|
||||||
return await updateReference(owner, repo, `heads/${branch}`, commit.sha);
|
return await updateReference(owner, repo, `heads/${branch}`, commit.sha);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { githubRequest, buildUrl } from "../common/utils";
|
import { githubRequest, buildUrl } from "../common/utils.js";
|
||||||
import {
|
import {
|
||||||
GitHubIssueSchema,
|
GitHubIssueSchema,
|
||||||
GitHubLabelSchema,
|
GitHubLabelSchema,
|
||||||
GitHubIssueAssigneeSchema,
|
GitHubIssueAssigneeSchema,
|
||||||
GitHubMilestoneSchema,
|
GitHubMilestoneSchema,
|
||||||
} from "../common/types";
|
} from "../common/types.js";
|
||||||
|
|
||||||
// Schema definitions
|
// Schema definitions
|
||||||
export const CreateIssueOptionsSchema = z.object({
|
export const CreateIssueOptionsSchema = z.object({
|
||||||
@@ -148,4 +148,4 @@ export async function getIssue(
|
|||||||
);
|
);
|
||||||
|
|
||||||
return GitHubIssueSchema.parse(response);
|
return GitHubIssueSchema.parse(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { githubRequest } from "../common/utils";
|
import { githubRequest } from "../common/utils.js";
|
||||||
import {
|
import {
|
||||||
GitHubIssueAssigneeSchema,
|
GitHubIssueAssigneeSchema,
|
||||||
GitHubRepositorySchema
|
GitHubRepositorySchema
|
||||||
} from "../common/types";
|
} from "../common/types.js";
|
||||||
|
|
||||||
// Schema definitions
|
// Schema definitions
|
||||||
export const GitHubPullRequestHeadSchema = z.object({
|
export const GitHubPullRequestHeadSchema = z.object({
|
||||||
@@ -115,4 +115,4 @@ export async function listPullRequests(
|
|||||||
|
|
||||||
const response = await githubRequest(url.toString());
|
const response = await githubRequest(url.toString());
|
||||||
return z.array(GitHubPullRequestSchema).parse(response);
|
return z.array(GitHubPullRequestSchema).parse(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { githubRequest } from "../common/utils";
|
import { githubRequest } from "../common/utils.js";
|
||||||
import { GitHubRepositorySchema, GitHubSearchResponseSchema } from "../common/types";
|
import { GitHubRepositorySchema, GitHubSearchResponseSchema } from "../common/types.js";
|
||||||
|
|
||||||
// Schema definitions
|
// Schema definitions
|
||||||
export const CreateRepositoryOptionsSchema = z.object({
|
export const CreateRepositoryOptionsSchema = z.object({
|
||||||
@@ -62,4 +62,4 @@ export async function forkRepository(
|
|||||||
parent: GitHubRepositorySchema,
|
parent: GitHubRepositorySchema,
|
||||||
source: GitHubRepositorySchema,
|
source: GitHubRepositorySchema,
|
||||||
}).parse(response);
|
}).parse(response);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
import { githubRequest, buildUrl } from "../common/utils";
|
import { githubRequest, buildUrl } from "../common/utils.js";
|
||||||
|
|
||||||
// Schema definitions
|
// Schema definitions
|
||||||
export const SearchCodeSchema = z.object({
|
export const SearchCodeSchema = z.object({
|
||||||
@@ -101,4 +101,4 @@ export async function searchUsers(params: SearchUsersParams): Promise<SearchUser
|
|||||||
const url = buildUrl("https://api.github.com/search/users", params);
|
const url = buildUrl("https://api.github.com/search/users", params);
|
||||||
const response = await githubRequest(url);
|
const response = await githubRequest(url);
|
||||||
return SearchUsersResponseSchema.parse(response);
|
return SearchUsersResponseSchema.parse(response);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user