Spaces:
Sleeping
Sleeping
| import axios from 'axios' | |
| const api = axios.create({ | |
| baseURL: '/api/v1', | |
| timeout: 30000, | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| }, | |
| }) | |
| // Time Series | |
| export const getTimeSeriesPosts = (params) => | |
| api.get('/timeseries/posts', { params }) | |
| export const getTimeSeriesPostsData = (params) => | |
| api.get('/timeseries/posts/data', { params }) | |
| export const getTimeSeriesPostsSummary = (params) => | |
| api.get('/timeseries/posts/summary', { params }) | |
| export const getTimeSeriesEngagement = (params) => | |
| api.get('/timeseries/engagement', { params }) | |
| export const getTimeSeriesEngagementData = (params) => | |
| api.get('/timeseries/engagement/data', { params }) | |
| export const getTimeSeriesEngagementSummary = (params) => | |
| api.get('/timeseries/engagement/summary', { params }) | |
| export const getTopicTrends = (params) => | |
| api.get('/timeseries/topics', { params }) | |
| export const askAboutChart = (data) => | |
| api.post('/timeseries/ask', data) | |
| // Search | |
| export const searchPosts = (data) => | |
| api.post('/search', data) | |
| export const searchTimeSeries = (data) => | |
| api.post('/search/timeseries', data) | |
| // Network | |
| export const getNetworkGraph = (params) => | |
| api.get('/network/graph', { params }) | |
| export const getNetworkGraphData = (params) => | |
| api.get('/network/graph/data', { params }) | |
| export const getNetworkGraphSummary = (params) => | |
| api.get('/network/graph/summary', { params }) | |
| export const removeNetworkNode = (author, params = {}) => | |
| api.get(`/network/remove-node/${encodeURIComponent(author)}`, { params }) | |
| // Clusters | |
| export const getClusters = (params) => | |
| api.get('/clusters', { params }) | |
| export const getClustersData = (params) => | |
| api.get('/clusters/data', { params }) | |
| export const getClustersSummary = (params) => | |
| api.get('/clusters/summary', { params }) | |
| // Summary | |
| export const generateSummary = (data) => | |
| api.post('/summary/generate', data) | |
| // Overview stats | |
| export const getOverviewStats = () => | |
| api.get('/overview/stats') | |
| export const getOverviewStatsData = () => | |
| api.get('/overview/data') | |
| export const getOverviewSummary = () => | |
| api.get('/overview/summary') | |
| // Embeddings summary | |
| export const getEmbeddingsSummary = () => | |
| api.get('/embeddings/summary') | |
| // Compare two subreddits | |
| export const getCompareSubredditsStats = (sub1, sub2) => | |
| api.get('/compare/stats', { params: { sub1, sub2 } }) | |
| export const getCompareSubredditsSummary = (sub1, sub2) => | |
| api.get('/compare/summary', { params: { sub1, sub2 } }) | |
| export const getCompareSubreddits = (sub1, sub2) => | |
| api.get('/compare', { params: { sub1, sub2 } }) | |
| export default api | |