Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ export const VALID_TAGS = [
"other",
] as const

export const VALID_DATABASES = ['mysql', 'postgresql'] as const

export type ValidTag = typeof VALID_TAGS[number]
export type ValidDatabase = typeof VALID_DATABASES[number]
21 changes: 2 additions & 19 deletions generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from 'node:fs'
import * as path from 'node:path'
import { fileURLToPath } from 'node:url'
import { parse as parseToml } from 'toml'
import { VALID_TAGS, VALID_DATABASES, ValidTag, ValidDatabase } from './constants.js'
import { VALID_TAGS, ValidTag } from './constants.js'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
Expand All @@ -14,7 +14,6 @@ interface PluginTomlPlugin {
description: string
author: string
tags?: ValidTag[]
database?: ValidDatabase[]
}

interface PluginToml {
Expand Down Expand Up @@ -205,18 +204,6 @@ function generatePluginData(pluginsDir: string, gitmodulesPath: string, existing
}
}

// Validate and filter database
let database: ValidDatabase[] | undefined
if (rawPlugin.database && Array.isArray(rawPlugin.database)) {
const filtered = rawPlugin.database
.map(db => db.toLowerCase() as ValidDatabase)
.filter((db): db is ValidDatabase => VALID_DATABASES.includes(db))
if (filtered.length > 0) {
// @ts-ignore
database = [...new Set(filtered)]
}
}

const icon = resolveIconUrl(rawPlugin.icon, gitModule.url, gitModule.branch)
const plugin: PluginTomlPlugin = {
...(icon && { icon }),
Expand All @@ -225,7 +212,6 @@ function generatePluginData(pluginsDir: string, gitmodulesPath: string, existing
description: rawPlugin.description,
author: rawPlugin.author,
...(tags && { tags }),
...(database && { database }),
}

pluginDataListByPath.set(gitModule.path, {
Expand All @@ -245,10 +231,8 @@ function generatePluginData(pluginsDir: string, gitmodulesPath: string, existing

function generateTypeScriptCode(pluginDataList: PluginData[]): string {
return `export const validTags = ${ JSON.stringify(VALID_TAGS, null, 2) } as const
export const validDatabases = ${ JSON.stringify(VALID_DATABASES, null, 2) } as const

export type ValidTag = typeof validTags[number]
export type ValidDatabase = typeof validDatabases[number]

export interface PluginTomlPlugin {
icon?: string
Expand All @@ -257,7 +241,6 @@ export interface PluginTomlPlugin {
description: string
author: string
tags?: ValidTag[]
database?: ValidDatabase[]
}

export interface GitModule {
Expand Down Expand Up @@ -293,7 +276,7 @@ function main() {

fs.writeFileSync(
path.join(baseDir, 'plugins-data.json'),
JSON.stringify({ validTags: VALID_TAGS, validDatabases: VALID_DATABASES, pluginDataList }, null, 2),
JSON.stringify({ validTags: VALID_TAGS, pluginDataList }, null, 2),
'utf-8'
)

Expand Down
94 changes: 11 additions & 83 deletions plugins-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,17 @@
"payment",
"other"
],
"validDatabases": [
"mysql",
"postgresql"
],
"pluginDataList": [
{
"plugin": {
"icon": "https://wu-clan.github.io/picx-images-hosting/logo/fba.svg",
"summary": "AI",
"version": "1.0.0",
"version": "1.0.1",
"description": "为系统提供基础 AI 文本对话能力,包含供应商、模型、默认模型、快捷短语和会话管理",
"author": "wu-clan",
"tags": [
"agent",
"ai"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -41,17 +33,13 @@
"plugin": {
"icon": "https://wu-clan.github.io/picx-images-hosting/logo/fba.svg",
"summary": "AI Buddy",
"version": "0.1.0",
"version": "0.1.1",
"description": "为系统提供 Buddy 全量 AI 能力,由后端提供接口,前端后台管理,客户端在同一对话内切工作或编码",
"author": "wu-clan",
"tags": [
"agent",
"ai",
"mcp"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -64,15 +52,11 @@
"plugin": {
"icon": "https://wu-clan.github.io/picx-images-hosting/logo/fba.svg",
"summary": "AI Buddy Group",
"version": "0.1.0",
"version": "0.1.1",
"description": "用于管理 AI Buddy 资源分组及资源可见性",
"author": "wu-clan",
"tags": [
"ai"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand Down Expand Up @@ -136,15 +120,11 @@
{
"plugin": {
"summary": "API Key",
"version": "0.0.5",
"version": "0.0.6",
"description": "用户自定义 API Key 管理,支持生成、管理和使用 API Key 进行接口认证",
"author": "wu-clan",
"tags": [
"auth"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand Down Expand Up @@ -177,10 +157,6 @@
"author": "as-fba",
"tags": [
"storage"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand Down Expand Up @@ -208,15 +184,11 @@
{
"plugin": {
"summary": "Casbin RBAC",
"version": "0.0.3",
"version": "0.0.4",
"description": "基于 Casbin 实现的 RBAC 访问控制",
"author": "wu-clan",
"tags": [
"auth"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -228,15 +200,11 @@
{
"plugin": {
"summary": "Casdoor SSO",
"version": "0.0.5",
"version": "0.0.6",
"description": "通过 Casdoor 实现 SSO 单点登录集成",
"author": "wu-clan",
"tags": [
"auth"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -248,14 +216,11 @@
{
"plugin": {
"summary": "验证码识别服务",
"version": "0.0.1",
"version": "0.0.2",
"description": "基于 ddddocr 的本地验证码识别 API(文本/滑块/点选)",
"author": "david",
"tags": [
"other"
],
"database": [
"mysql"
]
},
"git": {
Expand Down Expand Up @@ -286,9 +251,6 @@
"tags": [
"mcp",
"auth"
],
"database": [
"mysql"
]
},
"git": {
Expand Down Expand Up @@ -322,10 +284,6 @@
"author": "yzbf",
"tags": [
"storage"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -337,15 +295,11 @@
{
"plugin": {
"summary": "OSS",
"version": "0.0.6",
"version": "0.0.7",
"description": "阿里云 OSS 文件上传",
"author": "wu-clan",
"tags": [
"storage"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -358,15 +312,11 @@
"plugin": {
"icon": "https://wu-clan.github.io/picx-images-hosting/logo/fba.svg",
"summary": "S3",
"version": "0.0.3",
"version": "0.0.4",
"description": "提供兼容 S3 协议的对象存储配置与文件读写能力",
"author": "wu-clan",
"tags": [
"storage"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand Down Expand Up @@ -413,9 +363,6 @@
"author": "pd-qa-backend",
"tags": [
"task"
],
"database": [
"mysql"
]
},
"git": {
Expand Down Expand Up @@ -444,15 +391,11 @@
{
"plugin": {
"summary": "Task",
"version": "0.0.3",
"version": "0.0.4",
"description": "基于 taskiq 的异步任务队列插件",
"author": "wu-clan",
"tags": [
"task"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -464,15 +407,11 @@
{
"plugin": {
"summary": "多租户",
"version": "0.0.2",
"version": "0.0.3",
"description": "为系统提供多租户能力,包括租户管理、套餐管理、行级数据隔离",
"author": "wu-clan",
"tags": [
"other"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand All @@ -490,10 +429,6 @@
"tags": [
"ai",
"other"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand Down Expand Up @@ -527,9 +462,6 @@
"author": "Shj366",
"tags": [
"other"
],
"database": [
"mysql"
]
},
"git": {
Expand Down Expand Up @@ -563,10 +495,6 @@
"tags": [
"task",
"notification"
],
"database": [
"mysql",
"postgresql"
]
},
"git": {
Expand Down
Loading
Loading