mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
Shows bot and cabinet releases with version badges, changelogs, and update detection via __APP_VERSION__.
33 lines
677 B
TypeScript
33 lines
677 B
TypeScript
import apiClient from './client';
|
|
|
|
// ============ Types ============
|
|
|
|
export interface ReleaseItem {
|
|
tag_name: string;
|
|
name: string;
|
|
body: string;
|
|
published_at: string;
|
|
prerelease: boolean;
|
|
}
|
|
|
|
export interface ProjectReleasesInfo {
|
|
current_version: string;
|
|
has_updates: boolean;
|
|
releases: ReleaseItem[];
|
|
repo_url: string;
|
|
}
|
|
|
|
export interface ReleasesResponse {
|
|
bot: ProjectReleasesInfo;
|
|
cabinet: ProjectReleasesInfo;
|
|
}
|
|
|
|
// ============ API ============
|
|
|
|
export const adminUpdatesApi = {
|
|
getReleases: async (): Promise<ReleasesResponse> => {
|
|
const response = await apiClient.get('/cabinet/admin/updates/releases');
|
|
return response.data;
|
|
},
|
|
};
|