Skip to content

Commit

Permalink
✨ feat: update schema types
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Aug 24, 2023
1 parent 7a270ef commit 4cb0e53
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
38 changes: 16 additions & 22 deletions src/types/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,34 @@ export interface PluginSchema extends Omit<JSONSchema7, 'type'> {
type: 'object';
}

export interface LobeChatPluginApi {
description: string;
name: string;
parameters: PluginSchema;
/**
* Endpoint URL
* @desc The endpoint URL of the plugin
* @nameCN 服务端接口
* @descCN 插件服务端的接口地址 URL
*/
url: string;
}

/**
* Plugin manifest
* @desc Represents the manifest of a plugin
* @nameCN 插件清单
* @descCN 描述一个插件的构成要素
*/
export interface LobeChatPlugin {
export interface LobeChatPluginManifest {
api: LobeChatPluginApi[];
/**
* Plugin name
* @desc The name of the plugin
* @nameCN 插件名称
* @descCN 插件的名称,需要和提交到 LobeChat Plugins 仓库的插件名称一致
*/
name: string;
/**
* Plugin schema
* @desc The schema of the plugin
* @nameCN 插件模式
* @descCN 插件的模式
*/
schema: {
description: string;
name: string;
parameters: PluginSchema;
};
server: {
/**
* Endpoint URL
* @desc The endpoint URL of the plugin
* @nameCN 服务端接口
* @descCN 插件服务端的接口地址 URL
*/
url: string;
};
identifier: string;
/**
* plugin ui on user side
* @desc The type of rendering for the plugin
Expand Down
16 changes: 9 additions & 7 deletions src/types/market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface LobeChatPluginsMarketIndex {
* @nameCN 版本
* @descCN 插件的版本
*/
version: 1;
schemaVersion: 1;
}

/**
Expand All @@ -28,6 +28,7 @@ export interface LobeChatPluginsMarketIndex {
* @descCN 插件项接口
*/
export interface LobeChatPluginMeta {
author: string;
/**
* createAt
* @desc Creation date of the plugin
Expand All @@ -42,6 +43,11 @@ export interface LobeChatPluginMeta {
* @descCN 插件的主页
*/
homepage: string;
/**
* plugin identifier
* @nameCN 插件的名称
*/
identifier: string;
/**
* manifest url of this plugin
* @desc Manifest of the plugin
Expand All @@ -55,17 +61,12 @@ export interface LobeChatPluginMeta {
* @descCN 包含图片与标签等
*/
meta: Meta;
/**
* plugin name
* @nameCN 插件的名称
*/
name: string;
/**
* Manifest schema version
* @desc The version of the plugin manifest schema
* @nameCN 插件清单的版本
*/
schemaVersion: 'v1';
schemaVersion: number;
}

/**
Expand Down Expand Up @@ -96,4 +97,5 @@ export interface Meta {
* @descCN 插件的标签
*/
tags?: string[];
title: string;
}

0 comments on commit 4cb0e53

Please sign in to comment.