You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailchat/client/shared/model/plugin.ts

92 lines
1.5 KiB
TypeScript

import { request } from '../api/request';
export interface PluginManifest {
/**
*
* @example
*/
label: string;
/**
* ,
* @example com.msgbyte.webview
*/
name: string;
/**
*
*/
url: string;
/**
*
* : 128x128
*/
icon?: string;
/**
*
* semver
*
* major.minor.patch
* @example 1.0.0
*/
version: string;
/**
*
*/
author: string;
/**
*
*/
description: string;
/**
*
*/
requireRestart: boolean;
/**
*
* markdown, html使iframe
*/
documentUrl?: string;
}
/**
*
*
*
*/
export async function fetchRegistryPlugins(): Promise<PluginManifest[]> {
const { data } = await request.get('/api/plugin/registry/list');
return data;
}
/**
*
*
*
*/
export async function fetchServiceRegistryPlugins(): Promise<PluginManifest[]> {
const { data } = await request.get('/registry-be.json');
return data;
}
/**
* registry
*
*
*/
export async function fetchLocalStaticRegistryPlugins(): Promise<
PluginManifest[]
> {
const { data } = await request.get('/registry.json', { baseURL: '' });
return data;
}