Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/Paca-AI/first-party/github
go 1.24

require (
github.com/Paca-AI/plugin-sdk-go v0.2.0-rc.6
github.com/Paca-AI/plugin-sdk-go v0.2.0
github.com/google/uuid v1.6.0
)
4 changes: 2 additions & 2 deletions backend/go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/Paca-AI/plugin-sdk-go v0.2.0-rc.6 h1:XN5rln12wkqfhiDg3Ds98WZhX1oiGqWDBRHWoE03wYY=
github.com/Paca-AI/plugin-sdk-go v0.2.0-rc.6/go.mod h1:5WeC6cSEf2wM1ovICZbDaVky9oi5id/Qpdfc5LDAQnw=
github.com/Paca-AI/plugin-sdk-go v0.2.0 h1:Fur6p+OQoC5imq7qmvaQtJnZ3SRVRskx8KcT/rqFHj4=
github.com/Paca-AI/plugin-sdk-go v0.2.0/go.mod h1:5WeC6cSEf2wM1ovICZbDaVky9oi5id/Qpdfc5LDAQnw=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
4 changes: 2 additions & 2 deletions frontend/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@originjs/vite-plugin-federation": "^1.3.6",
"@paca-ai/plugin-sdk-react": "^0.1.0",
"@paca-ai/plugin-sdk-react": "^0.2.0",
"@types/react": "^19.2.0",
"@types/react-dom": "^19.2.0",
"typescript": "^5.8.3",
Expand Down
24 changes: 12 additions & 12 deletions frontend/src/github-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,26 +128,26 @@ export const taskBranchesKey = (projectId: string, taskId: string) =>
export async function getGitHubIntegration(
api: PluginApiClient,
): Promise<GitHubIntegration> {
return api.pluginGet<GitHubIntegration>(PLUGIN_ID, "/github");
return api.pluginGet<GitHubIntegration>(PLUGIN_ID, `/projects/${api.projectId}/github`);
}

export async function setGitHubToken(
api: PluginApiClient,
token: string,
): Promise<GitHubIntegration> {
return api.pluginPost<GitHubIntegration>(PLUGIN_ID, "/github/token", {
return api.pluginPost<GitHubIntegration>(PLUGIN_ID, `/projects/${api.projectId}/github/token`, {
token,
});
}

export async function deleteGitHubToken(api: PluginApiClient): Promise<void> {
return api.pluginDelete(PLUGIN_ID, "/github/token");
return api.pluginDelete(PLUGIN_ID, `/projects/${api.projectId}/github/token`);
}

export async function listAccessibleRepos(
api: PluginApiClient,
): Promise<AccessibleRepo[]> {
return api.pluginGet<AccessibleRepo[]>(PLUGIN_ID, "/github/repositories");
return api.pluginGet<AccessibleRepo[]>(PLUGIN_ID, `/projects/${api.projectId}/github/repositories`);
}

export async function linkRepository(
Expand All @@ -157,7 +157,7 @@ export async function linkRepository(
): Promise<LinkedRepository> {
return api.pluginPost<LinkedRepository>(
PLUGIN_ID,
"/github/linked-repositories",
`/projects/${api.projectId}/github/linked-repositories`,
{ owner, repo_name: repoName },
);
}
Expand All @@ -167,7 +167,7 @@ export async function listLinkedRepositories(
): Promise<LinkedRepository[]> {
return api.pluginGet<LinkedRepository[]>(
PLUGIN_ID,
"/github/linked-repositories",
`/projects/${api.projectId}/github/linked-repositories`,
);
}

Expand All @@ -177,7 +177,7 @@ export async function unlinkRepository(
): Promise<void> {
return api.pluginDelete(
PLUGIN_ID,
`/github/linked-repositories/${repoId}`,
`/projects/${api.projectId}/github/linked-repositories/${repoId}`,
);
}

Expand All @@ -187,7 +187,7 @@ export async function listTaskPRs(
): Promise<PullRequest[]> {
return api.pluginGet<PullRequest[]>(
PLUGIN_ID,
`/tasks/${taskId}/github/pull-requests`,
`/projects/${api.projectId}/tasks/${taskId}/github/pull-requests`,
);
}

Expand All @@ -199,7 +199,7 @@ export async function linkPRToTask(
): Promise<PullRequest> {
return api.pluginPost<PullRequest>(
PLUGIN_ID,
`/tasks/${taskId}/github/pull-requests`,
`/projects/${api.projectId}/tasks/${taskId}/github/pull-requests`,
{ repo_id: repoId, pr_number: prNumber },
);
}
Expand All @@ -211,7 +211,7 @@ export async function unlinkPRFromTask(
): Promise<void> {
return api.pluginDelete(
PLUGIN_ID,
`/tasks/${taskId}/github/pull-requests/${prId}`,
`/projects/${api.projectId}/tasks/${taskId}/github/pull-requests/${prId}`,
);
}

Expand All @@ -221,7 +221,7 @@ export async function listTaskBranches(
): Promise<TaskBranch[]> {
return api.pluginGet<TaskBranch[]>(
PLUGIN_ID,
`/tasks/${taskId}/github/branches`,
`/projects/${api.projectId}/tasks/${taskId}/github/branches`,
);
}

Expand All @@ -234,7 +234,7 @@ export async function createBranch(
): Promise<CreateBranchResult> {
return api.pluginPost<CreateBranchResult>(
PLUGIN_ID,
`/tasks/${taskId}/github/branches`,
`/projects/${api.projectId}/tasks/${taskId}/github/branches`,
{ repo_id: repoId, branch_name: branchName, source_branch: sourceBranch },
);
}
24 changes: 12 additions & 12 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"routes": [
{
"method": "GET",
"path": "/github",
"path": "/projects/:projectId/github",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -23,7 +23,7 @@
},
{
"method": "POST",
"path": "/github/token",
"path": "/projects/:projectId/github/token",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -36,7 +36,7 @@
},
{
"method": "DELETE",
"path": "/github/token",
"path": "/projects/:projectId/github/token",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -49,7 +49,7 @@
},
{
"method": "GET",
"path": "/github/repositories",
"path": "/projects/:projectId/github/repositories",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -62,7 +62,7 @@
},
{
"method": "GET",
"path": "/github/linked-repositories",
"path": "/projects/:projectId/github/linked-repositories",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -75,7 +75,7 @@
},
{
"method": "POST",
"path": "/github/linked-repositories",
"path": "/projects/:projectId/github/linked-repositories",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -88,7 +88,7 @@
},
{
"method": "DELETE",
"path": "/github/linked-repositories/:repoId",
"path": "/projects/:projectId/github/linked-repositories/:repoId",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -101,7 +101,7 @@
},
{
"method": "GET",
"path": "/tasks/:taskId/github/pull-requests",
"path": "/projects/:projectId/tasks/:taskId/github/pull-requests",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -114,7 +114,7 @@
},
{
"method": "POST",
"path": "/tasks/:taskId/github/pull-requests",
"path": "/projects/:projectId/tasks/:taskId/github/pull-requests",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -127,7 +127,7 @@
},
{
"method": "DELETE",
"path": "/tasks/:taskId/github/pull-requests/:prId",
"path": "/projects/:projectId/tasks/:taskId/github/pull-requests/:prId",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -140,7 +140,7 @@
},
{
"method": "POST",
"path": "/tasks/:taskId/github/branches",
"path": "/projects/:projectId/tasks/:taskId/github/branches",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand All @@ -153,7 +153,7 @@
},
{
"method": "GET",
"path": "/tasks/:taskId/github/branches",
"path": "/projects/:projectId/tasks/:taskId/github/branches",
"middlewares": [
{ "name": "optionalAuthn" },
{ "name": "requireFreshPassword" },
Expand Down