mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-11 05:20:57 +00:00
feat: marketplace page
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { IDynamicFormItemSchema } from '@/app/infra/entities/form/dynamic';
|
||||
import { PipelineConfigTab } from '@/app/infra/entities/pipeline';
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
import { I18nObject } from '@/app/infra/entities/common';
|
||||
import { Message } from '@/app/infra/entities/message';
|
||||
import { Plugin } from '@/app/infra/entities/plugin';
|
||||
import { Plugin, PluginV4 } from '@/app/infra/entities/plugin';
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
code: number;
|
||||
@@ -24,8 +24,8 @@ export interface ApiRespProviderRequester {
|
||||
|
||||
export interface Requester {
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
description: I18nLabel;
|
||||
label: I18nObject;
|
||||
description: I18nObject;
|
||||
icon?: string;
|
||||
spec: {
|
||||
config: IDynamicFormItemSchema[];
|
||||
@@ -82,8 +82,8 @@ export interface ApiRespPlatformAdapter {
|
||||
|
||||
export interface Adapter {
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
description: I18nLabel;
|
||||
label: I18nObject;
|
||||
description: I18nObject;
|
||||
icon?: string;
|
||||
spec: {
|
||||
config: IDynamicFormItemSchema[];
|
||||
@@ -183,26 +183,13 @@ export interface ApiRespUserToken {
|
||||
token: string;
|
||||
}
|
||||
|
||||
export interface MarketPlugin {
|
||||
ID: number;
|
||||
CreatedAt: string; // ISO 8601 格式日期
|
||||
UpdatedAt: string;
|
||||
DeletedAt: string | null;
|
||||
name: string;
|
||||
author: string;
|
||||
description: string;
|
||||
repository: string; // GitHub 仓库路径
|
||||
artifacts_path: string;
|
||||
stars: number;
|
||||
downloads: number;
|
||||
status: 'initialized' | 'mounted'; // 可根据实际状态值扩展联合类型
|
||||
synced_at: string;
|
||||
pushed_at: string; // 最后一次代码推送时间
|
||||
export interface ApiRespMarketplacePlugins {
|
||||
plugins: PluginV4[];
|
||||
total: number;
|
||||
}
|
||||
|
||||
export interface MarketPluginResponse {
|
||||
plugins: MarketPlugin[];
|
||||
total: number;
|
||||
export interface ApiRespMarketplacePluginDetail {
|
||||
plugin: PluginV4;
|
||||
}
|
||||
|
||||
interface GetPipelineConfig {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface I18nLabel {
|
||||
export interface I18nObject {
|
||||
en_US: string;
|
||||
zh_Hans: string;
|
||||
ja_JP?: string;
|
||||
@@ -9,12 +9,12 @@ export interface ComponentManifest {
|
||||
kind: string;
|
||||
metadata: {
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
description?: I18nLabel;
|
||||
label: I18nObject;
|
||||
description?: I18nObject;
|
||||
icon?: string;
|
||||
repository?: string;
|
||||
version?: string;
|
||||
author?: string;
|
||||
};
|
||||
spec: object;
|
||||
spec: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
import { I18nObject } from '@/app/infra/entities/common';
|
||||
|
||||
export interface IDynamicFormItemSchema {
|
||||
id: string;
|
||||
default: string | number | boolean | Array<unknown>;
|
||||
label: I18nLabel;
|
||||
label: I18nObject;
|
||||
name: string;
|
||||
required: boolean;
|
||||
type: DynamicFormItemType;
|
||||
description?: I18nLabel;
|
||||
description?: I18nObject;
|
||||
options?: IDynamicFormItemOption[];
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ export enum DynamicFormItemType {
|
||||
|
||||
export interface IDynamicFormItemOption {
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
label: I18nObject;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { I18nLabel } from '@/app/infra/entities/common';
|
||||
import { I18nObject } from '@/app/infra/entities/common';
|
||||
import { IDynamicFormItemSchema } from '@/app/infra/entities/form/dynamic';
|
||||
|
||||
export interface PipelineFormEntity {
|
||||
@@ -11,13 +11,13 @@ export interface PipelineFormEntity {
|
||||
|
||||
export interface PipelineConfigTab {
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
label: I18nObject;
|
||||
stages: PipelineConfigStage[];
|
||||
}
|
||||
|
||||
export interface PipelineConfigStage {
|
||||
name: string;
|
||||
label: I18nLabel;
|
||||
description?: I18nLabel;
|
||||
label: I18nObject;
|
||||
description?: I18nObject;
|
||||
config: IDynamicFormItemSchema[];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ComponentManifest } from '@/app/infra/entities/common';
|
||||
import { ComponentManifest, I18nObject } from '@/app/infra/entities/common';
|
||||
|
||||
export interface Plugin {
|
||||
status: 'intialized' | 'mounted' | 'unmounted';
|
||||
@@ -9,6 +9,8 @@ export interface Plugin {
|
||||
};
|
||||
debug: boolean;
|
||||
enabled: boolean;
|
||||
install_source: string;
|
||||
install_info: Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
|
||||
components: {
|
||||
component_config: object;
|
||||
manifest: {
|
||||
@@ -16,3 +18,27 @@ export interface Plugin {
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
// marketplace plugin v4
|
||||
export enum PluginV4Status {
|
||||
Any = 'any',
|
||||
Live = 'live',
|
||||
Deleted = 'deleted',
|
||||
}
|
||||
|
||||
export interface PluginV4 {
|
||||
id: number;
|
||||
plugin_id: string;
|
||||
author: string;
|
||||
name: string;
|
||||
label: I18nObject;
|
||||
description: I18nObject;
|
||||
icon: string;
|
||||
repository: string;
|
||||
tags: string[];
|
||||
install_count: number;
|
||||
latest_version: string;
|
||||
status: PluginV4Status;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user