Second deep audit→build→verify pass; all products typecheck clean. - gitgram-web (100): fix feed pagination, reel drafts, 6 gaps - gitgram-backend (99): add admin/moderator role checks to moderation routes; wire backend-e2e CI (Postgres+Redis services); 5 gaps - gitgram-mobile (97): fix broken create-reel flow; 11 gaps - aitm-core (98): dedupe vendored CLI command registrations; real vector search with local fallback; 7 gaps - aitm-api (99): replace hash-based embeddings with real OpenAI/Voyage embeddings (+ checkpoints test_status migration 0008); 8 gaps - aitm-mcp (99): add X-API-Key to workspace tool proxy calls; 8 gaps - aitm-website (94): fix annual billing checkout; 5 gaps Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
71 lines
2.1 KiB
TypeScript
71 lines
2.1 KiB
TypeScript
import api from './api';
|
|
|
|
export const repositoryService = {
|
|
search: async (query: string) => {
|
|
const response = await api.get(`/repositories/search?q=${encodeURIComponent(query)}`);
|
|
return response.data;
|
|
},
|
|
|
|
getTrending: async (language?: string) => {
|
|
const url = language
|
|
? `/repositories/trending?language=${language}`
|
|
: '/repositories/trending';
|
|
const response = await api.get(url);
|
|
return response.data;
|
|
},
|
|
|
|
get: async (owner: string, name: string) => {
|
|
const response = await api.get(`/repositories/${owner}/${name}`);
|
|
return response.data;
|
|
},
|
|
|
|
getPosts: async (owner: string, name: string) => {
|
|
const response = await api.get(`/repositories/${owner}/${name}/posts`);
|
|
return response.data;
|
|
},
|
|
|
|
follow: async (owner: string, name: string) => {
|
|
const response = await api.post(`/repositories/${owner}/${name}/follow`);
|
|
return response.data;
|
|
},
|
|
|
|
unfollow: async (owner: string, name: string) => {
|
|
const response = await api.delete(`/repositories/${owner}/${name}/follow`);
|
|
return response.data;
|
|
},
|
|
|
|
getFollowing: async () => {
|
|
const response = await api.get('/repositories/following');
|
|
return response.data;
|
|
},
|
|
|
|
parseUrl: async (url: string) => {
|
|
const response = await api.get('/repositories/parse-url', { params: { url } });
|
|
return response.data;
|
|
},
|
|
|
|
getComments: async (owner: string, name: string, page = 1, limit = 20) => {
|
|
const response = await api.get(`/repositories/${owner}/${name}/comments`, {
|
|
params: { page, limit },
|
|
});
|
|
return response.data;
|
|
},
|
|
|
|
addComment: async (owner: string, name: string, content: string) => {
|
|
const response = await api.post(`/repositories/${owner}/${name}/comments`, { content });
|
|
return response.data;
|
|
},
|
|
|
|
getReactions: async (owner: string, name: string) => {
|
|
const response = await api.get(`/repositories/${owner}/${name}/reactions`);
|
|
return response.data;
|
|
},
|
|
|
|
addReaction: async (owner: string, name: string, type: string) => {
|
|
const response = await api.post(`/repositories/${owner}/${name}/reactions`, { type });
|
|
return response.data;
|
|
},
|
|
};
|
|
|
|
export default repositoryService;
|