Attempt to make this work

This commit is contained in:
Mark Wylde
2025-05-31 00:44:27 +01:00
parent 87a39e8fbc
commit 72aa15ac4f

View File

@@ -75,7 +75,7 @@ server.tool(
}, },
async ({ issue_number }) => { async ({ issue_number }) => {
try { try {
const issue = await giteaRequest(`/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}`); const issue = await giteaRequest(`/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}`);
return { return {
content: [ content: [
@@ -113,7 +113,7 @@ server.tool(
}, },
async ({ issue_number, since, before }) => { async ({ issue_number, since, before }) => {
try { try {
let endpoint = `/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}/comments`; let endpoint = `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}/comments`;
const params = new URLSearchParams(); const params = new URLSearchParams();
if (since) params.append("since", since); if (since) params.append("since", since);
@@ -161,7 +161,7 @@ server.tool(
async ({ issue_number, body }) => { async ({ issue_number, body }) => {
try { try {
const comment = await giteaRequest( const comment = await giteaRequest(
`/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}/comments`, `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}/comments`,
"POST", "POST",
{ body }, { body },
); );
@@ -202,7 +202,7 @@ server.tool(
async ({ comment_id, body }) => { async ({ comment_id, body }) => {
try { try {
const comment = await giteaRequest( const comment = await giteaRequest(
`/repos/${REPO_OWNER}/${REPO_NAME}/issues/comments/${comment_id}`, `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/comments/${comment_id}`,
"PATCH", "PATCH",
{ body }, { body },
); );
@@ -242,7 +242,7 @@ server.tool(
async ({ comment_id }) => { async ({ comment_id }) => {
try { try {
await giteaRequest( await giteaRequest(
`/repos/${REPO_OWNER}/${REPO_NAME}/issues/comments/${comment_id}`, `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/comments/${comment_id}`,
"DELETE", "DELETE",
); );
@@ -280,7 +280,7 @@ server.tool(
}, },
async ({ comment_id }) => { async ({ comment_id }) => {
try { try {
const comment = await giteaRequest(`/repos/${REPO_OWNER}/${REPO_NAME}/issues/comments/${comment_id}`); const comment = await giteaRequest(`/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/comments/${comment_id}`);
return { return {
content: [ content: [
@@ -323,7 +323,7 @@ server.tool(
}, },
async ({ state, labels, milestone, assignee, creator, mentioned, page, limit }) => { async ({ state, labels, milestone, assignee, creator, mentioned, page, limit }) => {
try { try {
let endpoint = `/repos/${REPO_OWNER}/${REPO_NAME}/issues`; let endpoint = `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues`;
const params = new URLSearchParams(); const params = new URLSearchParams();
if (state) params.append("state", state); if (state) params.append("state", state);
@@ -389,7 +389,7 @@ server.tool(
if (labels) issueData.labels = labels; if (labels) issueData.labels = labels;
const issue = await giteaRequest( const issue = await giteaRequest(
`/repos/${REPO_OWNER}/${REPO_NAME}/issues`, `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues`,
"POST", "POST",
issueData, issueData,
); );
@@ -446,7 +446,7 @@ server.tool(
if (state) updateData.state = state; if (state) updateData.state = state;
const issue = await giteaRequest( const issue = await giteaRequest(
`/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}`, `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/issues/${issue_number}`,
"PATCH", "PATCH",
updateData, updateData,
); );
@@ -483,7 +483,7 @@ server.tool(
{}, {},
async () => { async () => {
try { try {
const repo = await giteaRequest(`/repos/${REPO_OWNER}/${REPO_NAME}`); const repo = await giteaRequest(`/api/v1/repos/${REPO_OWNER}/${REPO_NAME}`);
return { return {
content: [ content: [
@@ -523,7 +523,7 @@ server.tool(
}, },
async ({ state, head, base, page, limit }) => { async ({ state, head, base, page, limit }) => {
try { try {
let endpoint = `/repos/${REPO_OWNER}/${REPO_NAME}/pulls`; let endpoint = `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/pulls`;
const params = new URLSearchParams(); const params = new URLSearchParams();
if (state) params.append("state", state); if (state) params.append("state", state);
@@ -572,7 +572,7 @@ server.tool(
}, },
async ({ pull_number }) => { async ({ pull_number }) => {
try { try {
const pull = await giteaRequest(`/repos/${REPO_OWNER}/${REPO_NAME}/pulls/${pull_number}`); const pull = await giteaRequest(`/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/pulls/${pull_number}`);
return { return {
content: [ content: [
@@ -624,7 +624,7 @@ server.tool(
if (labels) pullData.labels = labels; if (labels) pullData.labels = labels;
const pull = await giteaRequest( const pull = await giteaRequest(
`/repos/${REPO_OWNER}/${REPO_NAME}/pulls`, `/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/pulls`,
"POST", "POST",
pullData, pullData,
); );