mirror of
https://github.com/MengMengCode/VoCat.git
synced 2026-08-15 04:13:42 +08:00
- Implemented `telegramAPIURL` and `validateTelegramAPIURL` functions for constructing and validating Telegram API URLs. - Added semantic versioning utilities in `version.go` to compare versions and validate semantic version formats. - Created tests for version comparison logic in `version_test.go`. - Introduced IMS call handling in `call_runtime.go`, including methods for dialing, answering, and hanging up calls. - Added tests for incoming call handling and validation in `call_runtime_test.go`. - Developed a new `PluginsCard` component for managing plugins via URL or file upload in the web interface. - Implemented plugin management functions in `extensions.ts` and created an `ExtensionPage` for displaying plugin contributions.
36 lines
852 B
TypeScript
36 lines
852 B
TypeScript
import { api } from "./api";
|
|
|
|
export interface PluginContribution {
|
|
id: string;
|
|
label: string;
|
|
labelZh?: string;
|
|
location: "sidebar" | "proxy";
|
|
after?: string;
|
|
entry: string;
|
|
}
|
|
|
|
export interface InstalledPlugin {
|
|
id: string;
|
|
name: string;
|
|
version: string;
|
|
description?: string;
|
|
author?: string;
|
|
homepage?: string;
|
|
permissions?: string[];
|
|
contributions: PluginContribution[];
|
|
enabled: boolean;
|
|
backendAvailable: boolean;
|
|
backendRunning: boolean;
|
|
backendError?: string;
|
|
installedAt: string;
|
|
sha256: string;
|
|
}
|
|
|
|
export function listPlugins() {
|
|
return api<InstalledPlugin[]>("/extensions");
|
|
}
|
|
|
|
export function pluginAssetURL(plugin: InstalledPlugin, contribution: PluginContribution) {
|
|
return `/plugin-assets/${encodeURIComponent(plugin.id)}/${contribution.entry.split("/").map(encodeURIComponent).join("/")}`;
|
|
}
|