Commit fcdf6bf8 authored by Administrator's avatar Administrator

Update frontend/src/api.js via Son of Anton

parent 63f19650
......@@ -170,32 +170,64 @@ export const refreshRepoContext = (token, chatId) =>
// ═══════════════════════════════════════════
// GitLab — Admin (for GitLab Command Center)
// Canonical names + gitlab-prefixed aliases
// used by GitLabPage.jsx
// ═══════════════════════════════════════════
export const getGitlabSettings = (token) => request("GET", "/gitlab/settings", token);
export const gitlabGetSettings = getGitlabSettings;
export const updateGitlabSettings = (token, data) => request("PUT", "/gitlab/settings", token, data);
export const gitlabUpdateSettings = updateGitlabSettings;
export const testGitlabConnection = (token) => request("POST", "/gitlab/test-connection", token);
export const gitlabTestConnection = testGitlabConnection;
export const searchGitlabProjects = (token, search, owned) =>
request("GET", `/gitlab/projects?search=${encodeURIComponent(search || "")}&owned=${owned || false}`, token);
export const gitlabSearchProjects = searchGitlabProjects;
export const createGitlabProject = (token, data) => request("POST", "/gitlab/projects", token, data);
export const gitlabCreateProject = createGitlabProject;
export const adminListRepos = (token) => request("GET", "/gitlab/repos", token);
export const gitlabListRepos = adminListRepos;
export const linkRepo = (token, gitlabProjectId) => request("POST", "/gitlab/repos", token, { gitlab_project_id: gitlabProjectId });
export const gitlabLinkRepo = linkRepo;
export const unlinkRepo = (token, repoId) => request("DELETE", `/gitlab/repos/${repoId}`, token);
export const gitlabUnlinkRepo = unlinkRepo;
export const analyzeRepo = (token, repoId) => request("POST", `/gitlab/repos/${repoId}/analyze`, token);
export const gitlabAnalyzeRepo = analyzeRepo;
export const getRepoMap = (token, repoId) => request("GET", `/gitlab/repos/${repoId}/map`, token);
export const getRepoTree = (token, repoId, path, ref) =>
request("GET", `/gitlab/repos/${repoId}/tree?path=${encodeURIComponent(path || "")}&ref=${encodeURIComponent(ref || "")}`, token);
export const gitlabGetTree = getRepoTree;
export const getRepoFile = (token, repoId, path, ref) =>
request("GET", `/gitlab/repos/${repoId}/file?path=${encodeURIComponent(path)}&ref=${encodeURIComponent(ref || "")}`, token);
export const gitlabGetFile = getRepoFile;
export const adminGetBranches = (token, repoId) => request("GET", `/gitlab/repos/${repoId}/branches`, token);
export const adminCommitFiles = (token, repoId, data) => request("POST", `/gitlab/repos/${repoId}/commit`, token, data);
export const adminCommitSingle = (token, repoId, data) => request("POST", `/gitlab/repos/${repoId}/commit-single`, token, data);
export const createBranch = (token, repoId, data) => request("POST", `/gitlab/repos/${repoId}/branches`, token, data);
export const createMergeRequest = (token, repoId, data) => request("POST", `/gitlab/repos/${repoId}/merge-request`, token, data);
export const listActions = (token, status) => request("GET", `/gitlab/actions?status=${status || "pending"}`, token);
export const gitlabListActions = listActions;
export const createAction = (token, data) => request("POST", "/gitlab/actions", token, data);
export const approveAction = (token, actionId) => request("POST", `/gitlab/actions/${actionId}/approve`, token);
export const gitlabApproveAction = approveAction;
export const rejectAction = (token, actionId) => request("POST", `/gitlab/actions/${actionId}/reject`, token);
export const gitlabRejectAction = rejectAction;
// ═══════════════════════════════════════════
// Export (PPTX / DOCX)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment