Feat(Electron-store): Add electron store

Add electron store to support install tool
This commit is contained in:
2024-05-08 12:36:16 +08:00
parent d677aeed07
commit 1ef2db5f47
9 changed files with 334 additions and 14 deletions

78
src/main/global.d.ts vendored
View File

@@ -11,3 +11,81 @@ interface ImportMetaEnv {
interface ImportMeta {
readonly env: ImportMetaEnv
}
interface StoreSchema {
installedTools: Record<string, Record<Platform, ToolVo>>
}
interface ToolVo {
id: string
name: string
toolId: string
icon: string
platform: Platform
description: string
base: ToolBaseVo
author: UserWithInfoVo
ver: string
keywords: string[]
categories: ToolCategoryVo[]
source: ToolDataVo
dist: ToolDataVo
entryPoint: string
publish: string
review: 'NONE' | 'PROCESSING' | 'PASS' | 'REJECT'
createTime: string
updateTime: string
favorite: boolean
}
interface ToolBaseVo {
id: string
name: string
source: ToolDataVo
dist: ToolDataVo
platform: Platform
compiled: boolean
createTime: string
updateTime: string
}
interface ToolDataVo {
id: string
data?: string
createTime?: string
updateTime?: string
}
interface UserWithInfoVo {
id: string
username: string
twoFactor: boolean
verified: boolean
locking: boolean
expiration: string
credentialsExpiration: string
enable: boolean
currentLoginTime: string
currentLoginIp: string
lastLoginTime: string
lastLoginIp: string
createTime: string
updateTime: string
userInfo: UserInfoVo
}
interface UserInfoVo {
id: string
userId: string
nickname: string
avatar: string
email: string
}
interface ToolCategoryVo {
id: string
name: string
enable: boolean
createTime: string
updateTime: string
}